Monogramm / docker-dolibarr

:whale: :elephant: Docker image for Dolibarr.
https://github.com/Dolibarr/dolibarr
GNU Affero General Public License v3.0
71 stars 23 forks source link

Losing data when I restart the container #61

Closed jbwittner closed 4 years ago

jbwittner commented 4 years ago

Describe the bug

When i restart the docker container the path /var/www/html are reset.

Context

This is my docker-compose file :

version: '3.7'

services:
    mariadb:
      image: mariadb:10.4
      volumes:
        - database:/var/lib/mysql
      command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
      environment:
          MYSQL_ROOT_PASSWORD: mySecretPassword2020
      ports:
          - "3306:3306"
      networks:
        backend:
          aliases:
            - mariadb
            - db

    php-fpm-dolibarr:
      image: monogramm/docker-dolibarr:11.0-fpm
      restart: always
      volumes:
        - dolibarr-html:/var/www/html
        - dolibarr-documents:/var/www/documents
        - dolibarr-scripts:/var/www/scripts
      environment:
          DOLI_DB_HOST: mariadb
          DOLI_DB_USER: dolibarr-user
          DOLI_DB_PASSWORD: myDolibarrSecret2020
          DOLI_DB_NAME: dolibarr
          DOLI_URL_ROOT: https://my.url.fr
          DOLI_HTTPS: https://my.url.fr
      depends_on:
          - mariadb
      networks:
        - backend

volumes:
  dolibarr-html:
  dolibarr-documents:
  dolibarr-scripts:
  database:

# See https://docs.docker.com/compose/networking/
networks:
  backend:
    driver: bridge

To Reproduce

Upload a file to the ECM.

When i enter into the container i can see my file :

root@4749e65ad153:/var/www/html/documents/ecm/MyTest# ls
23024.pdf

If y restart the container with this command :

root@myServer:~# docker restart webapps_php-fpm-dolibarr_1
webapps_php-fpm-dolibarr_1

I can return into the container and i didn't see my file :

root@4749e65ad153:/var/www/html/documents# ls
users

Docker:

root@myServer:~# docker --version
Docker version 19.03.8, build afacb8b7f0

Desktop (please complete the following information):

OS: Ubuntu 18
Browser Any
Version Any