Skip to content

Commit

Permalink
Added MySQL data volume to docker compose (#20982)
Browse files Browse the repository at this point in the history
no issue

- This allows us to run `docker-compose down` or to restart docker
desktop without losing all our local databases
- Added a data volume to the MySQL service in the `docker-compose.yml`
file to persist the data between container restarts
- The `yarn docker:reset` command will still reset all the data in the
database since it uses `down -v` to remove the volumes as well
  • Loading branch information
cmraible authored Sep 12, 2024
1 parent eb796e0 commit 2a0d49c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
volumes:
# Turns out you can drop .sql or .sql.gz files in here, cool!
- ./mysql-preload:/docker-entrypoint-initdb.d
- mysql-data:/var/lib/mysql
healthcheck:
test: "mysql -uroot -proot ghost -e 'select 1'"
interval: 1s
Expand All @@ -36,4 +37,6 @@ services:
- "9411:9411"
restart: always
environment:
COLLECTOR_ZIPKIN_HOST_PORT: :9411
COLLECTOR_ZIPKIN_HOST_PORT: :9411
volumes:
mysql-data:

0 comments on commit 2a0d49c

Please sign in to comment.