Docker Compose Apps¶
The file structure responsible for creating a Docker Compose App is:
The combination of a top-level directory containing a docker-compose.yml
file
will end-up in a Docker Compose App.
The docker-compose.yml
file specifies one or more containers to run and each container configuration.
Foundries hub as source¶
Dockerfile in the same folder
In the shellhttpd
example, the docker-compose.yml
file specified the Docker
Container Image from the Foundries hub: hub.foundries.io/${FACTORY}/shellhttpd:latest
.
In this case, the Docker Container Image shellhttpd
is generated
by Dockerfile
in the shellhttpd
folder.
shellhttpd/docker-compose.yml:
Dockerfile in a different folder
In some cases, the Docker Container Image comes from a different
application created in the containers.git
repository.
This is very common when you have a Docker Container Image used by multiple Docker Compose Apps.
For example:
In this case, the app/docker-compose.yml
file looks like this:
app/docker-compose.yml:
External hub as source¶
A Docker Compose App can specify a Docker Container Image from an external host. A good example is images from Docker hub.
For example:
In this case, the app/docker-compose.yml
file looks like this:
app/docker-compose.yml:
Multiple source¶
Last but not least, you can mix all the three examples on simple or multiple container applications. For example:
In this case, the shellhttpd/docker-compose.yml
file specify three different
Docker Container Images:
app/docker-compose.yml:
httpd
: A Docker Container Image created from the sameshellhttpd
folder.dashboard
: A Docker Container Image created from thegrafana
folder.mosquitto
: The mosquitto Docker Container Image fromhub.docker.com
.