From 03b61a4095c81c1ccab2c0941058d2166732d215 Mon Sep 17 00:00:00 2001 From: rugk Date: Sat, 10 Jul 2021 02:32:08 +0200 Subject: [PATCH] Always persist caddy data directory/volume (#1986) * Always persist caddy data directory/volume This defines the volume as external in order to avoid the problem that `docker-compose down` removes the volume. This makes sure the volume is not accidentally removed. This is important, because of the reasons the Readme describes further above. That volume must not be treated as temporary. See https://docs.docker.com/compose/compose-file/compose-file-v3/#external Ref https://forums.docker.com/t/why-docker-compose-down-deletes-my-volume-how-to-define-volume-as-external/67433 --- caddy/content.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/caddy/content.md b/caddy/content.md index 95353a4b2..6c802113f 100644 --- a/caddy/content.md +++ b/caddy/content.md @@ -131,5 +131,8 @@ services: volumes: caddy_data: + external: true caddy_config: ``` + +Defining the data volume as [`external`](https://docs.docker.com/compose/compose-file/compose-file-v3/#external) makes sure `docker-compose down` does not delete the volume. You may need to create it manually using `docker volume create [project-name]_caddy_data`.