From bb5a36d79d3e41e1c7f300a1fda4aef6f03529b9 Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Wed, 9 Oct 2024 23:03:10 +0100 Subject: [PATCH] Added mysql and redis services --- docker-compose.yml | 28 +++++++++++++++++++ .../shared/config/env/config.dockerdev.json | 4 +-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e327ee5cb2..23c54f7e60 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,3 +13,31 @@ services: - NODE_ENV=dockerdev - DEBUG=${DEBUG} - APP_FLAGS=${APP_FLAGS} + mysql: + image: mysql:8.0.35 + container_name: ghost-full-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-full-redis + ports: + - "6379:6379" + restart: always + +volumes: + mysql-data: \ No newline at end of file diff --git a/ghost/core/core/shared/config/env/config.dockerdev.json b/ghost/core/core/shared/config/env/config.dockerdev.json index 8153faf11f..d475eaec8d 100644 --- a/ghost/core/core/shared/config/env/config.dockerdev.json +++ b/ghost/core/core/shared/config/env/config.dockerdev.json @@ -6,7 +6,7 @@ "database": { "client": "mysql", "connection": { - "host": "ghost-mysql", + "host": "ghost-full-mysql", "user": "root", "password": "root", "database": "ghost" @@ -14,7 +14,7 @@ }, "adapters": { "Redis": { - "host": "ghost-redis", + "host": "ghost-full-redis", "port": 6379 } }