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:
Why This Works¶
- Shared infrastructure is started first: The
qualtarget ensuresshared.ymlis running before startingqualification.yml - No need for orphan removal: Since shared infrastructure is managed separately, we don't need to remove "orphans" when starting qualification services
- 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
Related Files¶
Makefile-qualtarget (line ~182)infrastructure/compose/shared.yml- Shared infrastructure definitioninfrastructure/compose/qualification.yml- Qualification services definition