Using Docker Swarm
Closed this issue · 1 comments
Hello,
I'm trying the image using docker swarm. Here is my command line for creating a service. (I created a database before it)
docker service create --replicas 2 -d --name "Dolibarr_swarm" -e DOLI_DB_HOST="PUBLIC_IP" -e DOLI_DB_USER="user" -e DOLI_DB_PASSWORD="password" -e DOLI_DB_NAME="dolibarr" -e DOLI_ADMIN_LOGIN="admin" -e DOLI_ADMIN_PASSWORD="password" -e PHP_INI_DATE_TIMEZONE='Europe/Paris' -p 80 tuxgasy/dolibarr:latest
Here is what I'm having :
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
8aodq4b4j0r0 Dolibarr_swarm.1 tuxgasy/dolibarr:latest worker Running Running 25 minutes ago
And If I ado a docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
101ac4cjca5e tuxgasy/dolibarr@sha256:c2a6c1e1ed7844a5bc74dc2fdd1d27a1dea843b59917d17a617a12e129a06642 "docker-run.sh" 25 minutes ago Up 25 minutes 80/tcp
And if I inspect for the published port :
docker service inspect f1tkeah11hw6skr4qcb91kabc | grep Port
"Ports": [
"TargetPort": 80,
"Ports": [
"TargetPort": 80,
"Ports": [
"TargetPort": 80,
"PublishedPort": 30000,
I can't access dolibarr using port 30000
Here is the logs :
[INIT] => update PHP Config ...
[INIT] => update Dolibarr Config ...
[INIT] => update ownership for file in Dolibarr Config ...
[INIT] => update ownership for files in /var/www/documents ...
Current Version is : 12.0.2
Last installed Version is : 12.0.2
Schema update is not required ... Enjoy !!
AH00557: apache2: apr_sockaddr_info_get() failed for a151a8f8b4f7
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
AH00557: apache2: apr_sockaddr_info_get() failed for a151a8f8b4f7
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Fri Aug 21 13:49:59.777959 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.8 configured -- resuming normal operations
[Fri Aug 21 13:49:59.781506 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
can you try with this command instead:
docker service create --replicas 2 -d --name "Dolibarr_swarm" -e DOLI_DB_HOST="PUBLIC_IP" -e DOLI_DB_USER="user" -e DOLI_DB_PASSWORD="password" -e DOLI_DB_NAME="dolibarr" -e DOLI_ADMIN_LOGIN="admin" -e DOLI_ADMIN_PASSWORD="password" -e PHP_INI_DATE_TIMEZONE='Europe/Paris' -p 80:80 tuxgasy/dolibarr:latest
I think specifying explicitely the external port will solve your exposed port issue ...