How do I get around this manual intervention when installing with docker-compose

Hi,

I’m installing pydio cells server using docker compose on a VPS. I set it up to run locally behind an Nginx reverse proxy (on the same VPS). I have linked the docker-compose.yml file (example dot com is not the actual domain used) at the end of this post.

Long story short: everything works now. After spinning up with “docker compose up -d” I went to pydio.example.com in a web-browser to finish the installation. During the installation, you have to state where your database is located, and I had to look up the host manually with

docker inspect pydio_mysql_1

(i.e. docker inspect $dbname). It was the value IPADDR under they key-value pair “IPAddress: $IPADDR” under “Networks”: { … } in the dictionary.

It’s not too hard to do this, but it would be nice if this could be automated somehow so that I don’t need to look at anything. For example, could it be set up so that localhost works as the database address, instead of an IP address which I get at runtime? Is there something else I’m missing?

Thanks!

Jonathan

Link to docker-compose.yml: Pydio docker-compose.yml example - Pastebin.com

Hello @Jonathan_Gallagher,

When you run containers using docker-compose it will create a network specifically for the docker-compose, therefore if you want to connect to the database you can use its name mysql (in the hostname field), the docker-compose network will resolve this name and connect you to the database.

Localhost, would not really work because it will try to resolve the localhost of the container running cells itself).

tldr: you can use the container name instead of an ip address.

Thank you that works!

This topic was automatically closed 11 days after the last reply. New replies are no longer allowed.