From a6026098b9bae228a5bf9681212eb1e17011c2d6 Mon Sep 17 00:00:00 2001 From: Yolan Romailler Date: Tue, 26 Sep 2023 00:48:05 +0200 Subject: [PATCH 1/4] Update stack.yml to have persistent data --- ghost/stack.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ghost/stack.yml b/ghost/stack.yml index eefc6e8a709b..9df02c7f3444 100644 --- a/ghost/stack.yml +++ b/ghost/stack.yml @@ -18,9 +18,17 @@ services: url: http://localhost:8080 # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired) #NODE_ENV: development + volumes: + - some-ghost-data:/var/lib/ghost/content db: image: mysql:8.0 restart: always environment: MYSQL_ROOT_PASSWORD: example + volumes: + - some-ghost-mysql:/var/lib/mysql + +volumes: + - some-ghost-data: + - some-ghost-mysql: From c7ca55ff836adef6e5403396b5cd89d091f2e5f2 Mon Sep 17 00:00:00 2001 From: Yolan Romailler Date: Wed, 22 Nov 2023 00:19:04 +0100 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: yosifkit --- ghost/stack.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/stack.yml b/ghost/stack.yml index 9df02c7f3444..f79e4714d5a4 100644 --- a/ghost/stack.yml +++ b/ghost/stack.yml @@ -19,7 +19,7 @@ services: # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired) #NODE_ENV: development volumes: - - some-ghost-data:/var/lib/ghost/content + - some-ghost-data:/var/lib/ghost/content db: image: mysql:8.0 @@ -30,5 +30,5 @@ services: - some-ghost-mysql:/var/lib/mysql volumes: - - some-ghost-data: - - some-ghost-mysql: + some-ghost-data: + some-ghost-mysql: From 7b941e5e294fd44ea14e3d310528cbbfea81cba5 Mon Sep 17 00:00:00 2001 From: Yolan Romailler Date: Wed, 22 Nov 2023 00:27:59 +0100 Subject: [PATCH 3/4] Use a depends_on on the ghost-db --- ghost/stack.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghost/stack.yml b/ghost/stack.yml index f79e4714d5a4..1d03c968c890 100644 --- a/ghost/stack.yml +++ b/ghost/stack.yml @@ -5,12 +5,14 @@ services: ghost: image: ghost:4-alpine restart: always + depends_on: + - ghost-db ports: - 8080:2368 environment: # see https://ghost.org/docs/config/#configuration-options database__client: mysql - database__connection__host: db + database__connection__host: ghost-db database__connection__user: root database__connection__password: example database__connection__database: ghost @@ -21,7 +23,7 @@ services: volumes: - some-ghost-data:/var/lib/ghost/content - db: + ghost-db: image: mysql:8.0 restart: always environment: From 3750e9afc070244615c01e3fa7ab14bd3e06b016 Mon Sep 17 00:00:00 2001 From: Yolan Romailler Date: Mon, 4 Dec 2023 13:24:35 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Tianon Gravi --- ghost/stack.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ghost/stack.yml b/ghost/stack.yml index 1d03c968c890..9d495d941a06 100644 --- a/ghost/stack.yml +++ b/ghost/stack.yml @@ -5,14 +5,12 @@ services: ghost: image: ghost:4-alpine restart: always - depends_on: - - ghost-db ports: - 8080:2368 environment: # see https://ghost.org/docs/config/#configuration-options database__client: mysql - database__connection__host: ghost-db + database__connection__host: db database__connection__user: root database__connection__password: example database__connection__database: ghost @@ -21,16 +19,16 @@ services: # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired) #NODE_ENV: development volumes: - - some-ghost-data:/var/lib/ghost/content + - ghost:/var/lib/ghost/content - ghost-db: + db: image: mysql:8.0 restart: always environment: MYSQL_ROOT_PASSWORD: example volumes: - - some-ghost-mysql:/var/lib/mysql + - db:/var/lib/mysql volumes: - some-ghost-data: - some-ghost-mysql: + ghost: + db: