Skip to content

Fix: qual Target Removing Shared Infrastructure Containers

Problem

When running make qual, the shared infrastructure containers (postgres, redis, rabbitmq, traefik, etc.) were being removed, even though they should remain running.

Root Cause

The qual target in the Makefile was using the --remove-orphans flag:

docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d --remove-orphans

The --remove-orphans flag tells Docker Compose to remove containers that: - Use the same networks/volumes as the current compose file - Are NOT defined in the current compose file

Since qualification.yml uses external networks (traefik-public, po-shared-network) that are also used by shared.yml, Docker Compose saw the shared infrastructure containers as "orphans" and removed them.

Solution

Removed the --remove-orphans flag from the qual target:

docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d

Why This Works

  1. Shared infrastructure is started first: The qual target ensures shared.yml is running before starting qualification.yml
  2. No need for orphan removal: Since shared infrastructure is managed separately, we don't need to remove "orphans" when starting qualification services
  3. Isolation: Each compose file only manages its own containers

When to Use --remove-orphans

The --remove-orphans flag is still useful in cleanup scenarios: - make clean - Intentionally removes all containers - make stop-shared - Stops shared infrastructure

Verification

After the fix, running make qual-stop followed by make qual should: - ✅ Stop only qualification containers - ✅ Start qualification containers - ✅ Leave shared infrastructure containers running

  • Makefile - qual target (line ~182)
  • infrastructure/compose/shared.yml - Shared infrastructure definition
  • infrastructure/compose/qualification.yml - Qualification services definition