Skip to content

Commit 728d2d2

Browse files
Merge pull request #305 from boxxroom/feature/mysql-cnf
Feat: Support MySQL/MariaDB configuration via mounted my.cnf
2 parents 5c9c79c + 3e89ed3 commit 728d2d2

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ _**MYSQL_LOG_DIR**_
119119

120120
This will be used to store Apache logs. The default value for this is `./logs/mysql`.
121121

122+
_**MYSQL_CNF**_
123+
124+
Define your custom `my.cnf` modifications to meet your database requirments.
125+
122126
## Web Server
123127

124128
Apache is configured to run on port 80. So, you can access it via `http://localhost`.

config/mysql/.gitkeep

Whitespace-only changes.

config/mysql/my.cnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[mysql]
2+
3+
[mysqld]

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ services:
4040
- ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d
4141
- ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql
4242
- ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
43+
- ${MYSQL_CNF-./config/mysql/my.cnf}:/etc/my.cnf
4344
environment:
4445
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
4546
MYSQL_DATABASE: ${MYSQL_DATABASE}

sample.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ DATABASE=mysql8
3131
MYSQL_INITDB_DIR=./config/initdb
3232
MYSQL_DATA_DIR=./data/mysql
3333
MYSQL_LOG_DIR=./logs/mysql
34+
MYSQL_CNF=./config/mysql/my.cnf
3435

3536
# If you already have the port 80 in use, you can change it (for example if you have Apache)
3637
HOST_MACHINE_UNSECURE_HOST_PORT=80

0 commit comments

Comments
 (0)