浏览代码

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
rugk 4 年之前
父节点
当前提交
03b61a4095
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      caddy/content.md

+ 3 - 0
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`.