I know this subject is not new but I want to create a photo server on a Raspi P4, OS Debian Bulleyesnn with Piwigo in a docker container.
I have 2 containers with Piwigo & Mariadb. Boths can communicate with each other but piwigo can’t connect to the server at installation
Here is my docker compose
Did I miss something ? Which hostname should I used ?
Thank in advance
I’m progressing :
I’m able to access the hostname when using http://192.168.1.28 but I can’t acess to the database.
any help please ?
Thanks in advance
change the database host to
piwigo_db and see if it works. you can’t reach it with what you’re doing because you didn’t publish the ports, so externally, it’s not accessible (external being your LAN) however, since it shared a custom bridge with piwigo, piwigo can access it using docker dns, as long as you use the container_name of mariadb in piwigo.
take a look at
for some more information on how this works.
Thanks Driz for this review.
changing the database host to piwigo_db doesn’t work.
I tried to expose port 3306 outside the container but docker “told” this port is already in use by a mariadb instance.
Maybe that’s the issue…
docker exec -it piwigo ping piwigo_db
and tell me the results of that
you shouldn’t NEED to expose the port so it shouldn’t matter
it seems both container can communicate together
media@jarvis:~ $ docker exec -it piwigo ping piwigo_db
PING piwigo_db (172.19.0.2): 56 data bytes
64 bytes from 172.19.0.2: seq=0 ttl=64 time=0.370 ms
64 bytes from 172.19.0.2: seq=1 ttl=64 time=0.302 ms
64 bytes from 172.19.0.2: seq=2 ttl=64 time=0.258 ms
64 bytes from 172.19.0.2: seq=3 ttl=64 time=0.302 ms
64 bytes from 172.19.0.2: seq=4 ttl=64 time=0.255 ms
64 bytes from 172.19.0.2: seq=5 ttl=64 time=0.358 ms
can you clarify what doesn’t work here, since your ping works? Is it the same “cannot connect to the server” error?
i’m going to guess a little based on
but where you put root, you should put
piwigo which is what you defined as the MYSQL_USER for the piwigo database. You may just be getting a host rejection from trying to login as root here
Hum…until then I had same “cannot connect to server” error .
Now , I have a "504 Gateway Time-out’’…
what are you doing when you get this error? mariadb isn’t a web page so you shouldn’t get anything like this.
for testing, i just spun this up
after clicking the button
After several trial, I’ve finally able to install Piwigo :
I remove all command relative to network.
The main difference between our decompose file are
- version “2.1” and "3.9 "
-dependance between the mariabd & piwigo :
- You have
- “container name” <–piwigo_db
- This didn’t work on my decompose, I have this :
- “name of service” <–mariadb2
Anyway, it’s working now
Here is the final decompose
Many thanks for your awesome support !!!