Explorar el Código

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 hace 4 años
padre
commit
03b61a4095
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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`.