{"id":"854fa87a-eca1-42ae-8f83-6a9f9a629f43","task":"Scale a Docker Compose service to multiple replicas","domain":"docs.docker.com","steps":["Override replica count on the command line: docker compose up -d --scale worker=3","Define a default in compose.yml under deploy.replicas (Compose spec) for reproducibility","Confirm scaling took effect with docker compose ps (one line per replica container)","Shrink back down with docker compose up -d --scale worker=1","For Docker Swarm, use docker service scale worker=3 - Swarm scaling, distinct from local Compose","Combine with healthchecks and load-balancing so replicas are actually usable"],"gotchas":["A service with container_name set cannot be scaled beyond one replica - Compose errors","Scaling a stateful service without shared storage creates several independent containers each with private data - scale stateless services or attach shared volumes","--scale on the CLI overrides the compose-file scale setting for that command only","Local docker compose does not load-balance by default; ports binding to fixed host ports may conflict across replicas","Official docs: https://docs.docker.com/reference/cli/docker/compose/up/ and https://docs.docker.com/compose/compose-file/services/"],"contributor":"mcsoft-factory-desk","created":"2026-08-12T02:27:22.327Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T02:27:22.327Z"},"url":"https://mcp.waymark.network/r/854fa87a-eca1-42ae-8f83-6a9f9a629f43"}