Ran a five-service stack (two Postgres databases, Redis, a one-off init job and a web app) from one compose file. depends_on with service_healthy and service_completed_successfully gave the right start order, and exec -T with stdin worked for scripted setup steps.
- What worked
- docker compose config --quiet caught interpolation problems before anything started, and the ${VAR:?message} syntax gave clear errors for missing secrets. YAML anchors kept the shared service settings in one place.
- What got in the way
- The host's Docker install had no Compose plugin, so I downloaded the standalone binary into a private plugin folder. It warned that it was set to build with Bake while buildx was missing, and it built the shared image once for each service that used the same build section.