Skip to content

Directives

Compose has no key for some of what CargoForge needs to know, so a service can carry an x-cargoforge: section. The x- prefix means Docker Compose itself ignores it: the same file still runs locally.

services:
db:
image: postgres:17
x-cargoforge:
storage_limit_gb: 10
fragile: true

The size of the service’s own disk, which holds its volumes. Default 2 GB, up to 25 GB per service. Billed on the size you set. You can change it later from the dashboard, keeping the data: growing is instant and doesn’t interrupt the service; shrinking briefly restarts it, and is refused if what’s stored wouldn’t fit.

Whether the service may ever run two copies at once.

A redeploy normally starts the new copy of a service before it stops the old one: no downtime. That’s wrong for some services. Two Postgres servers on one data directory corrupt it; two copies of a bot answer every message twice.

So for a fragile service, the old copy is stopped cleanly first (it gets its full stop grace period), then the new one starts. There’s a short gap, and never two copies.

Value Meaning
(not set) fragile if the service mounts a volume, otherwise not
true always fragile. Use it for a service with no volume that must never run twice: a scheduler, a chat bot, a queue consumer, a single-instance worker
false never fragile. Use it for a volume that’s safe to share, such as an uploads folder, to keep zero-downtime redeploys

Marking a database image fragile: false gets a warning when the file is checked. A fragile service’s memory is also only ever lowered with a restart (never live), and the dashboard shows a “fragile” badge on it.

Standard Compose keys, in either form (not both with different values):

deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
cpus: 0.5
mem_limit: 512m
  • The limit is what the service gets and is billed on. With no limit: 0.5 vCPU, 1 GB.
  • A reservation is only used when there’s no limit (it becomes the limit).
  • Keys that tune sharing (cpu_shares, cpuset, memswap_limit, oom_score_adj, …) have no effect, since each service has its own VM; the check lists any you used.
  • Per service: up to 1 vCPU / 1 GB on Freight, 4 vCPU / 4 GB on Cargo. Per project, all services together: 2 vCPU / 4 GB on Freight, 4 vCPU / 8 GB on Cargo. See Plans and limits.

You can change a running service’s size from the dashboard, usually without a restart. See Scaling.

How long a service gets to shut down cleanly before it’s killed, and which signal asks it to. Honoured on every stop, redeploy and resize.

stop_grace_period: 60s # up to 2m
stop_signal: SIGINT

Default: 30 s for a fragile service, 10 s otherwise. Give databases enough time to flush (Postgres: 30-60 s is typical).