Volumes problem

Hello, I installed dolibarr on my NAS SYNOLOGY DS923+ with “Project” Container manager…
The creation goes well when I launch my docker compose:

version: '3'
services:
  mariadb:
    image: mariadb:10.6
    container_name: dolibarr_db
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=${DB_NAME}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
    volumes:
      - /volume1/docker/dolibarr:/db/var/lib/mysql  # Physical path on the NAS
    # networks:  # Optional: to be deleted if unnecessary
    `   - dolibarr_net
  web:
    image: dolibarr/dolibarr:23.0.2 # Specific version (recommended)
    container_name: dolibarr_web
    restart: always
    ports:
      - "8088:80"
    user: 1029:100 # definition user docker
    environment:
      - DOLI_DB_HOST=mariadb
      - DOLI_DB_USER=${DB_USER}
      - DOLI_DB_PASSWORD=${DB_PASSWORD}
      - DOLI_DB_NAME=${DB_NAME}
      - DOLI_ADMIN_LOGIN=${DOLI_ADMIN_LOGIN}
      - DOLI_ADMIN_PASSWORD=${DOLI_ADMIN_PASSWORD}
    volumes:
      - /volume1/docker/dolibarr:/html/var/www/html
      - /volume1/docker/dolibarr:/documents/var/www/documents
    depends_on:
      - mariadb
    # networks:  # Optional: to be deleted if unnecessary
    `   - dolibarr_net
# volumes:  # Not necessary if you use physical paths
# networks:  # Optional: to be deleted if unnecessary

I have set up volumes with absolute paths to make sure that the installation will arrive in the correct directories I created.
Everything seems fine, except that the directories remain desperately empty, and generated an error 192.168.0.14:8088 returned a blank page: logical since there is nothing.

I trusted my antivirus…
I don’t know where the Dolibarr and Mariadb files are installed.
I’m at rock bottom…
Could you please help me?
Helpppppppppppppppp please… examined out of print.

I took the liberty to format your compose file content properly. Next time please click the “</>” icon from the wyswig-editor menu, so that code/logs are shared as preformated text. Otherwise it can easily become unreadable and people (including me) might lose interest in reading the post at all.

A Container Manager project indeed bases on a compose file content. A project is a deployed instance of all ressources from the compose file content. Synology’s container manager is actually one of the few that use the correct name :slight_smile:

It has been a while since I saw the Container Manager. Please remind me again how the Conatiner Manager is able to resolve the variables you have in the compose file content? Does it allow specifiying the env file? If not, this could already be the cause of your problem.

Based on what you shared so far, it’s kind of like Schroedinger’s cat: the containers are alive and dead at the same time. Please share the error messages from container logs, so we see what’s actually going wrong.

Did I miss something?

You mount /volume1/docker/dolibarr from the host to /db/var/lib/mysql inside the container. But you are looking for a folder under /docker/dolibarr/db

Since you are using a mariadb image, it looks to me that you misplaced the colon character. Didn’t you want to do this?

      - /volume1/docker/dolibarr/db:/var/lib/mysql  # Physical path on the NAS

Nah, I missed something. I didn’t notice that all host sides of the volume bind point to the same folder, and the contaienr side’s look strange as well.

Hello,
Yes, your right, i made an .env file for security.

But now, i have a lot of problems :

In the dolibar_web container : this message :

I dont think is it very hard to make an docker installation…

If you have an idea, i take it.

Thank you in advance.

Best regards
Laurent

I send under my compose.yml

*<version: '3.8'*

*services:*
*  dolibarr_web:*
*    image: dolibarr/dolibarr:23.0.2*
*    container_name: dolibarr_web*
*    network_mode: host  # Mode host pour le conteneur*
*    user: "1029:100"*
*    restart: unless-stopped*
*    environment:*
*      - APACHE_HTTP_PORT_NUMBER=8080  # Port Apache dans le conteneur*
*      - DOLI_DB_HOST=127.0.0.1  # MariaDB écoute sur localhost (mode host)*
*      - DOLI_DB_PORT=3307  # Port personnalisé pour MariaDB*
*      - DOLI_DB_NAME=${DB_NAME}*
*      - DOLI_DB_USER=${DB_USER}*
*      - DOLI_DB_PASSWORD=${DB_PASSWORD}*
*      - DOLI_ADMIN_LOGIN=${DOLI_ADMIN_LOGIN}*
*      - DOLI_ADMIN_PASSWORD=${DOLI_ADMIN_PASSWORD}*
*    volumes:*
*      - /volume1/docker/dolibarr/html:/var/www/html*
*      - /volume1/docker/dolibarr/documents:/var/www/documents*
*    depends_on:*
*      - dolibarr_db*

*  dolibarr_db:*
*    image: mariadb:10.6*
*    container_name: dolibarr_db*
*    network_mode: host  # Mode host pour le conteneur*
*    restart: always*
*    environment:*
*      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}*
*      - MYSQL_DATABASE=${DB_NAME}*
*      - MYSQL_USER=${DB_USER}*
*      - MYSQL_PASSWORD=${DB_PASSWORD}*
*      - MYSQL_TCP_PORT=3307  # Port personnalisé pour éviter les conflits*
*    command: --bind-address=0.0.0.0  # Force MariaDB à écouter sur toutes les interfaces*
*    volumes:*
*      - /volume1/docker/dolibarr/mysql:/var/lib/mysql>*

And in the dolibar_db this message :

Since you are using bind mounts, not really volumes, you have to set the right permissions on the host for all files. If that is not right, I understand why a config file canot be changed.

You have the user and group ID here to run the processes in the container:

If the file owner is different, the app in the container probbaly tries to change it, but has no permission as it is not root, so it cannot give it to another user or to itself.

Regarding the ini file, the docker-run shell script wants to create that, but your user has no access to that folder.

By the way dolibarr’s Docker image doesn’t look like it was designed to run as non-root as many commands in its start script requires a root user to work.

(non-English content removed by moderator)

The language of this community forum is English. Please, edit your post and translate it to English. Thank you!

Hello and sorry, rimelek,

So what should I do to make it all work: I am a beginner

Could you rewrite the compose.yml file for me and give me the command lines to use in my puTTY terminal? so that everything works.

That would be really cool of you.

Thank you in advance.

Best regards
Laurent

Sorry, my goal is to help you understand how you can solve your problem, not giving people the copy-paste ready solution unless it is too complex. I’m happy to rephrase anything you don’t understand first.

The dolibarr repo has an example docker compose file without the user parameter. You just need to remove the user parameter that I quoted from your message in my previous post. Then the container will start as root and will have permission to change the owner of files or create the ini file under the conf.d directory.

There is still no guarantee that it will work if there are other issues as well, but when you get a different error, we can interpret that too.