tuxgasy/docker-dolibarr

http://0.0.0.0/ displays just “It works”

dbitouze opened this issue · 9 comments

Thanks for providing this Docker image for Dolibarr!

I followed scrupulously your instructions and first faced the following error:

$ docker-compose up -d
Creating network "dolibarr_default" with the default driver
Pulling mariadb (mariadb:latest)...
latest: Pulling from library/mariadb
405f018f9d1d: Pull complete
7a85079b8234: Pull complete
579c7ff691b1: Pull complete
4976663b5d6d: Pull complete
169024b1fb13: Pull complete
c0ffe8ce897f: Pull complete
b583c09d23c3: Pull complete
9b9f0c08d08f: Pull complete
9cd51f984586: Pull complete
d9f506bb8aca: Pull complete
24d689f79ba4: Pull complete
Digest: sha256:88fcb7d92c7f61cd885c4d309c98461f3607aa6dbd57a2474be86e1956b36d13
Status: Downloaded newer image for mariadb:latest
Pulling web (tuxgasy/dolibarr:)...
latest: Pulling from tuxgasy/dolibarr
c32ce6654453: Pull complete
f244825368f6: Pull complete
0cb682e3d268: Pull complete
eea16ce02660: Pull complete
ca5b7334d364: Pull complete
ecbba56d4063: Pull complete
3822be6520ec: Pull complete
41c523c319c9: Pull complete
dd95c10f64f7: Pull complete
5f82f352ea51: Pull complete
fd46f7727d7b: Pull complete
34450d986a45: Pull complete
c398811107d9: Pull complete
2cd2a3698cea: Pull complete
ee34b1df1b48: Pull complete
8fdb6897cd86: Pull complete
6d58bd679f1f: Pull complete
Digest: sha256:7c7788bf2bc19f565fdb66103ddf8893a935e8ffe14e63d337ed758f75af1c37
Status: Downloaded newer image for tuxgasy/dolibarr:latest
Creating dolibarr_mariadb_1 ... done
Creating dolibarr_web_1     ... 
Creating dolibarr_web_1     ... error

ERROR: for dolibarr_web_1  Cannot start service web: driver failed programming external connectivity on
endpoint dolibarr_web_1 (443bedb8604371044a0be08ce1950aedaaf3d7d78572af356d23e16abacaf029):
Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

ERROR: for web  Cannot start service web: driver failed programming external connectivity on endpoint
dolibarr_web_1
(443bedb8604371044a0be08ce1950aedaaf3d7d78572af356d23e16abacaf029): Error starting userland proxy:
listen tcp4
0.0.0.0:80: bind: address already in use
Encountered errors while bringing up the project.

I managed by stopping the httpd service on my Linux box (Mageia 8) and retrying:

$ docker-compose up -d      
dolibarr_mariadb_1 is up-to-date
Recreating dolibarr_web_1 ... done

But, now, when I visit http://0.0.0.0/, it displays just “It works” instead to bring me to the new Dolibarr installation. I tried to visit http://0.0.0.0/dolibarr but it doesn't exist.

Thanks in advance for any hint.

Hi @dbitouze,
Can you check that you don't already have a stack with a port 80 on your machine?

  • With this command : docker ps. Checked if a container is not already on port 80. If no container is binded on port 80, do you have a web server on your machine ( except docker) ? If so, your port is unavailable.

Proposed solution : In your compose file, you can change the binded port to 8080 for example:

version: "3"

services:
    mariadb:
        image: mariadb:latest
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: dolibarr

    web:
        image: tuxgasy/dolibarr
        environment:
            DOLI_DB_HOST: mariadb
            DOLI_DB_USER: root
            DOLI_DB_PASSWORD: root
            DOLI_DB_NAME: dolibarr
            DOLI_URL_ROOT: 'http://0.0.0.0:8080'
            PHP_INI_DATE_TIMEZONE: 'Europe/Paris'
        ports:
            - "8080:80"
        links:
            - mariadb

I haven't tested it, but normally you should be able to access your instance from: http://0.0.0.0:8080/

I strongly advise you to use this kind of configuration to expose your applications on your machine: https://dev.to/flemssound/development-enviroment-with-docker-and-traefik-1lg6

Good luck

Hi and thanks @LaplancheMaxime for your answer!

After your suggested changes in the docker-compose.yml file:

$ docker stop dolibarr_web_1 dolibarr_mariadb_1                                                                                                                                                           
dolibarr_web_1
dolibarr_mariadb_1
$ docker ps                                    
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
$ docker-compose up -d          
Starting dolibarr_mariadb_1 ... done
Recreating dolibarr_web_1   ... done
$ docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED         STATUS         PORTS                                   NAMES
4b12fb9661ee   tuxgasy/dolibarr   "docker-run.sh apach…"   3 minutes ago   Up 3 minutes   0.0.0.0:8080->80/tcp, :::8080->80/tcp   dolibarr_web_1
9f4af7bbc763   mariadb:latest     "docker-entrypoint.s…"   2 hours ago     Up 3 minutes   3306/tcp                                dolibarr_mariadb_1

And:

# lsof -i -P -n | grep LISTEN | grep 80
barriers    46951         bitouze    6u  IPv6    91914      0t0  TCP *:24800 (LISTEN)
docker-pr 2938909            root    4u  IPv4 31455331      0t0  TCP *:8080 (LISTEN)
docker-pr 2938919            root    4u  IPv6 31454246      0t0  TCP *:8080 (LISTEN)

But it doesn't work (sorry, messages in French):

$ lynx http://0.0.0.0:8080/

Recherche 0.0.0.0:8080
Connexion HTTP à 0.0.0.0:8080
Envoi de la requête HTTP.
Requête HTTP envoyée. Attente de réponse.
Nouvel essai de requête HTTP0.
Recherche 0.0.0.0:8080
Connexion HTTP à 0.0.0.0:8080
Envoi de la requête HTTP.
Requête HTTP envoyée. Attente de réponse.
Alerte ! : Erreur de lecture inattendue ; connexion interrompue.
Accès impossible `http://0.0.0.0:8080/'
Alerte ! : Impossible d’accéder au document.

lynx : accès impossible au fichier de départ

Still no hint for this issue?

Hello

I think it's a problem with your machine, not the docker image. Do you have any other presentation services on it?

Hello, thanks for answering Maxime!

I think it's a problem with your machine, not the docker image.

Damned! :)

Do you have any other presentation services on it?

Sorry, I don't understand what you mean. Is it about port 80? Could lsof -i -P -n | grep LISTEN | grep 80 be irrelevant?

hi @dbitouze,

this kind of error :

ERROR: for dolibarr_web_1  Cannot start service web: driver failed programming external connectivity on
endpoint dolibarr_web_1 (443bedb8604371044a0be08ce1950aedaaf3d7d78572af356d23e16abacaf029):
Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

Often means that you have a software already using the port 80 ... often it's an apache server ... it could come with a distrib update or a package you installed.
You can use netstat -taupen | grep 80 to try to find out ... and probably service apache stop will help ^_^
The most important question is : is that web-server essential on this server ?

But definitely not an issue due to this image.
You can remap ports on docker-compose.yaml or start the dolibar container on a different port on your host.

Hi @mathieupotier and thanks for your answer!

this kind of error :

ERROR: for dolibarr_web_1  Cannot start service web: driver failed programming external connectivity on
endpoint dolibarr_web_1 (443bedb8604371044a0be08ce1950aedaaf3d7d78572af356d23e16abacaf029):
Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

Often means that you have a software already using the port 80 ... often it's an apache server ... it could come with a distrib update or a package you installed. You can use netstat -taupen | grep 80 to try to find out ...

Here is the output of this command:

# netstat -taupen | grep 80
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      980        31746      3370/postgres       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          48380      16774/master        
tcp        0      0 192.168.1.7:51040       34.107.221.82:80        ESTABLISHED 1000       56785099   19856/firefox       
tcp        0      0 192.168.1.7:53808       198.252.206.25:443      ESTABLISHED 1000       56159386   19856/firefox       
tcp        0      0 192.168.1.7:51030       34.107.221.82:80        ESTABLISHED 1000       56786374   19856/firefox       
tcp6       0      0 :::24800                :::*                    LISTEN      1000       20539141   2086444/barriers    
tcp6       0      0 :::39149                :::*                    LISTEN      1000       52543      18062/barrier       
udp        0      0 127.0.0.53:53           0.0.0.0:*                           988        18980      869/systemd-resolve 
udp        0      0 127.0.0.1:51972         127.0.0.1:51972         ESTABLISHED 980        30919      3370/postgres

so, AFAICS, no software already using the port 80.

and probably service apache stop will help ^_^

That's what I did after this error.

The most important question is : is that web-server essential on this server ?

In fact, it is not a server but my own computer where I occasionally need a web-server and where I'd like to test the newest version (15.0.2) of Dolibarr than the one (13.0.1) on the server of our association.

But definitely not an issue due to this image. You can remap ports on docker-compose.yaml

Do you mean, as suggested here?

or start the dolibar container on a different port on your host.

Well, sorry, I don't know how to proceed.

Hi,

Sorry for delay, but it's quite complicated to debug this kind of error, not being at your side... ^_^
I saw some error using apache image and reaching by http://0.0.0.0, can you try to change the value DOLI_URL_ROOT to http://localhost, and try to access it by this name ?
You can also try to access http://localhost/install page to ensure all is ok.

Sorry, for late response, hope it helps, or you already found the solution. ^_^

Regards