Add application file
Browse files- Dockerfile +18 -0
- my.cnf +2 -0
Dockerfile
CHANGED
@@ -1,3 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Use an official PHP image as the base image
|
2 |
FROM php:7.4-fpm
|
3 |
|
|
|
1 |
+
# Use the official MySQL 5.7 image as the base image
|
2 |
+
FROM mysql:5.7
|
3 |
+
|
4 |
+
# Add a custom SQL script to initialize the database
|
5 |
+
# COPY init.sql /docker-entrypoint-initdb.d/
|
6 |
+
|
7 |
+
# Add custom MySQL configuration
|
8 |
+
COPY my.cnf /etc/mysql/conf.d/
|
9 |
+
|
10 |
+
|
11 |
+
# Set environment variables (if needed)
|
12 |
+
ENV MYSQL_ROOT_PASSWORD=rootpassword
|
13 |
+
ENV MYSQL_DATABASE=mydatabase
|
14 |
+
ENV MYSQL_USER=myuser
|
15 |
+
ENV MYSQL_PASSWORD=mypassword
|
16 |
+
|
17 |
+
|
18 |
+
RUN mysqld
|
19 |
# Use an official PHP image as the base image
|
20 |
FROM php:7.4-fpm
|
21 |
|
my.cnf
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[mysqld]
|
2 |
+
log-bin-trust-function-creators=1
|