From 00fa073a8467904612c7fbc6539830b2743970d9 Mon Sep 17 00:00:00 2001
From: Quentin Duchemin <quentinduchemin@tuta.io>
Date: Thu, 11 Jun 2020 22:37:20 +0200
Subject: [PATCH] [Doc] Add volumes in template

---
 template/docker-compose.yml | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/template/docker-compose.yml b/template/docker-compose.yml
index 8cf9eeed..1b16dda7 100644
--- a/template/docker-compose.yml
+++ b/template/docker-compose.yml
@@ -1,11 +1,13 @@
 version: "3.7"
 
 volumes:
-  # Name of Docker volume
+  # Declaration of Docker volume
   # Also use a name so that Docker Compose does not add
   # the current folder name
-  myvolume:
-    name: myvolume
+  # Use as many volumes as you want : one for
+  # data, one for configuration, etc.
+  data:
+    name: data
 
 networks:
   # Best pratice : put all services that do not need
@@ -32,6 +34,15 @@ services:
     networks:
       - docker_default
       - app
+    volumes:
+      # Mount the Docker Volume in the container
+      # to persist the data. The mount point
+      # is service-dependant.
+      - data:/mount_point
+      # Exemple of mounting a file for configuration.
+      # This is not a Docker volume, but a versionned
+      # file is this repository.
+      - ./config.json:/config.json
     # Don't put the .example extension, the real
     # file will be a copy with real values
     env_file:
-- 
GitLab