From d275395c1fa73cb0f27c97e12ca71d2bcbf6b693 Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Tue, 17 Dec 2024 16:14:21 -0500 Subject: [PATCH] Added redis data volume to compose setup (#21906) 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). --- .devcontainer/compose.yml | 1 + compose.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.devcontainer/compose.yml b/.devcontainer/compose.yml index 9cdc05ca96..87c394d153 100644 --- a/.devcontainer/compose.yml +++ b/.devcontainer/compose.yml @@ -35,3 +35,4 @@ services: volumes: mysql-data: + redis-data: diff --git a/compose.yml b/compose.yml index ce71107a53..08e8a44472 100644 --- a/compose.yml +++ b/compose.yml @@ -26,6 +26,8 @@ services: ports: - "6379:6379" restart: always + volumes: + - redis-data:/data healthcheck: test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] interval: 1s @@ -61,3 +63,4 @@ services: - "9091:9091" volumes: mysql-data: + redis-data: