Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Use persistent volume for mysql container
Browse files Browse the repository at this point in the history
* Using the current working directory can result in permissions issues
if the UID / GID of the host don't match that of the mysql user in the
container. Using a docker volume allows us to persist the data and avoid
these permissions issues.
  • Loading branch information
nyanshak committed Oct 7, 2020
1 parent eeea84e commit 9e9898b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
mysql:
image: mysql:5.7
volumes:
- .:/tmp
- mysql-persistent-volume:/tmp
command: mysqld --datadir=/tmp/mysqldata --slow_query_log=1 --log_output=TABLE --log-queries-not-using-indexes --event-scheduler=ON
environment: &mysql-default-environment
MYSQL_ROOT_PASSWORD: toor
Expand Down Expand Up @@ -44,3 +44,6 @@ services:
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro

volumes:
mysql-persistent-volume:

0 comments on commit 9e9898b

Please sign in to comment.