Parcourir la source

Dolibarr: add volumes, and document update procedure

Guilhem Saurel il y a 6 ans
Parent
commit
131b1886db
3 fichiers modifiés avec 23 ajouts et 8 suppressions
  1. 0 1
      dolibarr/Dockerfile.fpm
  2. 17 7
      dolibarr/README.md
  3. 6 0
      dolibarr/docker-compose.yml

+ 0 - 1
dolibarr/Dockerfile.fpm

@@ -13,4 +13,3 @@ RUN apk --no-cache add postgresql-dev libpng-dev \
  && docker-php-ext-install gd pgsql zip
 
 COPY --from=0 htdocs /var/www/html
-RUN touch conf/conf.php && mkdir documents && chown www-data documents conf/conf.php

+ 17 - 7
dolibarr/README.md

@@ -1,15 +1,12 @@
 # Dolibarr
 
-## :warning: This is a WIP
-
-pour l’instant, la conf est supprimée à chaque update :/
-il faut binder les volumes entre fpm, nginx & l’hôte
-
 ## Usage
 
 ```
 echo POSTGRES_PASSWORD=$(openssl rand -base64 32) >> .env
 docker-compose up -d --build
+docker-compose exec app touch conf/conf.php
+docker-compose exec app chown www-data documents conf/conf.php
 ```
 
 Go to your webbrowser to finish installation:
@@ -17,9 +14,22 @@ Go to your webbrowser to finish installation:
 - DB password: look inside .env
 - DB port: empty
 
-- create admin user / password
-
 ```
 docker-compose exec app touch documents/install.lock
 docker-compose exec app chmod -w conf/conf.php documents/install.lock
 ```
+
+## Update
+
+```
+docker-compose pull
+docker-compose up -d --build
+docker-compose exec app rm documents/install.lock
+```
+
+Go to your webbrowser to finish upgrade
+
+```
+docker-compose exec app touch documents/install.lock
+docker-compose exec app chmod -w documents/install.lock
+```

+ 6 - 0
dolibarr/docker-compose.yml

@@ -20,6 +20,9 @@ services:
     restart: unless-stopped
     env_file:
       - .env
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/dolibarr/conf:/var/www/html/conf
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/dolibarr/documents:/var/www/html/documents
 
   web:
     build:
@@ -31,3 +34,6 @@ services:
     networks:
       - web
       - default
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/dolibarr/conf:/var/www/html/conf
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/dolibarr/documents:/var/www/html/documents