0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/.github/scripts/docker-compose.yml
Chris Raible 2a0d49c539
Added MySQL data volume to docker compose (#20982)
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
2024-09-12 09:38:24 -07:00

42 lines
1.1 KiB
YAML

version: '3.8'
name: ghost
services:
mysql:
image: mysql:8.0.35
container_name: ghost-mysql
# We'll need to look into how we can further fine tune the memory usage/performance here
command: --innodb-buffer-pool-size=1G --innodb-log-buffer-size=500M --innodb-change-buffer-max-size=50 --innodb-flush-log-at-trx_commit=0 --innodb-flush-method=O_DIRECT
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ghost
restart: always
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
retries: 120
redis:
image: redis:7.0
container_name: ghost-redis
ports:
- "6379:6379"
restart: always
jaeger:
image: jaegertracing/all-in-one:1.58
container_name: ghost-jaeger
ports:
- "4318:4318"
- "16686:16686"
- "9411:9411"
restart: always
environment:
COLLECTOR_ZIPKIN_HOST_PORT: :9411
volumes:
mysql-data: