mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 22:34:01 -05:00
d275395c1f
ref https://linear.app/ghost/issue/ENG-1956/redis-creates-new-anonymous-volume-each-time-it-boots - Before this commit, the redis service in our docker compose setup would create a new anonymous volume each time it boots, with a non-descriptive, hash-based name. Over time these volumes accumulate and become a pain to clean up, and it's not immediately obvious what they are used for. - This commit adds a persistent data volume for redis data, so it will reuse the same volume, with a more descriptive title each time it boots. This eliminates the annoying anonymous volumes, and also gives us data persistence across boots for the redis service (which can be easily cleared by deleting the volume).
38 lines
971 B
YAML
38 lines
971 B
YAML
# Base container and services for running Ghost
|
|
## Intended to be extended by another compose file
|
|
## e.g. docker compose -f base.compose.yml -f development.compose.yml up
|
|
## Does not include development dependencies, Ghost code, or any other dependencies
|
|
name: ghost-devcontainer
|
|
services:
|
|
ghost:
|
|
image: ghost-devcontainer
|
|
command: ["sleep", "infinity"]
|
|
build:
|
|
context: ../
|
|
dockerfile: .docker/Dockerfile
|
|
target: base-devcontainer
|
|
args:
|
|
WORKDIR: /workspaces/ghost
|
|
pull_policy: never
|
|
environment:
|
|
- DEVCONTAINER=true
|
|
tty: true
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
mysql:
|
|
extends:
|
|
file: ../compose.yml
|
|
service: mysql
|
|
container_name: ghost-devcontainer-mysql
|
|
redis:
|
|
extends:
|
|
file: ../compose.yml
|
|
service: redis
|
|
container_name: ghost-devcontainer-redis
|
|
|
|
volumes:
|
|
mysql-data:
|
|
redis-data:
|