Projects and services
Run a compose stack
Run several containers from one compose file, charged at the dedicated rate.
Updated
A compose stack runs several containers from one compose file, as one service. Use it when the software you want to run already ships with a compose file, or when its parts only make sense together.
Create the stack
On a project, press Add a service, then Create on the Docker Compose card. The form, "From a compose file", asks for:
Name: up to 40 characters.
Size: the rate the stack is charged at, from Small up. The section below explains why.
Compose file: "The file as you would write it beside your project, up to 256 KB."
services:
web:
image: nginx:alpinePress Create service. Cloud opens the stack's page and starts nothing yet. Press Deploy to start it.
The compose file is fixed once the stack exists: the stack's Overview shows it read only. To run a changed file, create another stack.
How a stack is charged
A stack is charged at the dedicated rate of the size you choose, which is why its sizes start at Small and why the stack's Overview lists its Pool as Dedicated.
The size sets the rate and nothing else. Cloud holds an application's containers to its size's CPU and memory, but it cannot hold the containers of a compose stack to them, so the size does not cap what the stack's containers use.
Each hour, Cloud counts the stack's running containers and charges that hour at the size's rate for each of them. A stack with three containers running is charged three times its size's hourly rate. The Order summary on the form shows the current rate, and Billing explains how charges are counted.
Environment
A stack has an environment of its own, one NAME=value per line, set on its Environment section. Cloud hands it to the stack as the stack is created and each time you save it. A running stack picks up a saved change only at its next deploy, so press Deploy after saving. Environment variables covers the rest.
Domains for a stack
A stack is never given an address of its own: add a domain to it with Add domain, on its Domains section or on the Domains page. A domain on a stack sends traffic to one service inside the compose file, so the dialog asks for two things an application's domain does not:
Compose service: "The service name in your compose file that receives web traffic", such as
web.Port: "The port this compose service listens on."
Cloud applies a stack's routes through a deployment of the stack. Once the domain's DNS checks pass, a deployment titled "Apply domain changes" starts with the trigger Redeploy, and the domain shows "The compose stack is deploying to apply its domain. Certificate verification will continue." Removing a stack's domain starts a Redeploy deployment too. Domains covers records, checks and statuses.
What differs from an application
| Area | For a compose stack |
|---|---|
| Containers | One per service in the file. |
| Size | Sets the dedicated rate, from Small up. No CPU or memory limit is applied. |
| Replicas | None: the file decides how many containers run. |
| Address | None is generated. Add a domain naming a compose service and its port. |
| Environment changes | Taken at the next deploy. |
| Logs | The Logs page and the Terminal page let you pick a container when the stack runs more than one. The stack's own Logs section streams the first running container. |
| Metrics | Not collected. The Metrics section reads "The agent has nothing for this service yet. Points appear a minute or two after it starts." and stays that way, so there is nothing to wait for. |
| Restart warning | Cloud does not track a stack's run attempts, so the "The engine keeps restarting this service" alert never appears. Read the Logs instead. |
| Volumes | Named volumes in the file's top-level volumes are listed on Storage as Managed by service. They cannot be detached on their own, and automatic backups do not cover them. |