Docker Compose Apps
This is the file structure responsible for creating the Docker Compose App:
└── containers
└── shellhttpd
└── docker-compose.yml
The combination of a top-level directory containing docker-compose.yml
will end-up in a Docker Compose App.
The docker-compose.yml
file specifies one or more containers to run and their configurations.
Foundries.io Hub as Source
Dockerfile in the Same Folder
In shellhttpd
, the docker-compose.yml
file specifies the Docker
container image from the Foundries.io hub, hub.foundries.io/${FACTORY}/shellhttpd:latest
.
Here, the Docker container image is generated by the Dockerfile
in the shellhttpd
folder.
└── containers
└── shellhttpd
├── docker-compose.yml
└── Dockerfile
shellhttpd/docker-compose.yml
:
services:
httpd:
image: hub.foundries.io/${FACTORY}/shellhttpd:latest
Dockerfile in a Different Folder
The Docker container image can also come from a different application created in containers.git
.
This is common when you have a Docker container image used by multiple Docker Compose Apps.
For example:
└── containers
├── app
│ └── docker-compose.yml
└── grafana
└── Dockerfile
In this case, app/docker-compose.yml
looks like this:
app/docker-compose.yml
:
services:
dashboard:
image: hub.foundries.io/${FACTORY}/grafana:latest
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:
└── containers
└── mosquitto
└── docker-compose.yml
In this case, app/docker-compose.yml
file looks like this:
app/docker-compose.yml
:
services:
mosquitto:
image: eclipse-mosquitto:1.6.12
Multiple Sources
You can can also mix the examples for both single and multiple container applications. For example:
└── containers
├── shellhttpd
│ ├── docker-compose.yml
│ └── Dockerfile
└── grafana
└── Dockerfile
In this case, shellhttpd/docker-compose.yml
specifies three different Docker container images:
app/docker-compose.yml
:
services:
httpd:
image: hub.foundries.io/${FACTORY}/shellhttpd:latest
dashboard:
image: hub.foundries.io/${FACTORY}/grafana:latest
mosquitto:
image: eclipse-mosquitto:1.6.12
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
.