docker compose mutiple containers

Soldato
Joined
20 Oct 2006
Posts
2,595
Location
London
Hi guys,

I am new to docker. I have been running webmin with ubuntu server for my web services such as wordpress etc.

I like the idea of docker that these ready built apps run as containers on one VM/machine.

My question is regarding the compose file.

If i want to run wordpress,nextcloud,piwik,grafana,

how would my compose file look ? and how would i reference all the different mariadb databases for each one.

many thanks
 
Are you running all the databases within a single database container or are you running multiple database containers?

IIRC, your service stanzas for the different applications would likely have key value pairs passed to them under the environment section which would define the database name and connection details which the application would need to connect to its database instance. What you need to pass could be specific to each application so you should look at the documentation for those images (the documentation may not mention docker compose but these are things which are passed to docker run using the -e switch).

You also may want to include a depends-on: section to your service stanzas so that the application container is related to the database container.

If you want to learn more about docker then the docker mastery course on Udemy seems to be version good.
 
Back
Top Bottom