tuxgasy/docker-dolibarr

Using mapped volumes

ScarlitoDoBrazil opened this issue · 1 comments

Hi.
I'm trying tu use mapped volumes so I can keep data outside of the container and back them up. Unfortunately, I must be missing something as it doesn't work (the html folder stay desperately empty.
Any idea of what I'm doing wrong ?
Everything works well if I remove the "volumes" part for the "web" service (but of course, that's not what I need, as data would stay inside the container).

Here is an example of my docker-compose.yaml file :

version: "3"

services:
    mariadb:
        image: mariadb:latest
        environment:
            MYSQL_DATABASE: dolibarr
            MYSQL_USER: my_user
            MYSQL_PASSWORD: my_password
            MYSQL_RANDOM_ROOT_PASSWORD: 1
        volumes:
          - ./db:/var/lib/mysql

    web:
        image: tuxgasy/dolibarr
        environment:
            DOLI_DB_HOST: mariadb
            DOLI_DB_NAME: dolibarr
            DOLI_DB_USER: my_user
            DOLI_DB_PASSWORD: my_password
            DOLI_URL_ROOT: 'http://0.0.0.0'
            DOLI_INSTALL_AUTO: 1
            PHP_INI_DATE_TIMEZONE: 'Europe/Paris'
        ports:
            - 8089:80
        links:
            - mariadb
        volumes:
            - ./html:/var/www/html
            - ./docs:/var/www/documents

Thanks for your help.

Hi.
I finally figured this out.
Actually, the "html" folder should not be redirected.
I now use the following configuration for the "volumes" part :

volumes:
    - ./documents:/var/www/documents
    - ./html/custom:/var/www/html/custom
    - ./conf.php:/var/www/html/conf/conf.php

You might update the documentation to specify how to set persistance, as I found several posts all over the place from people having the same issue.