Skip to content

fix: remove orphaned nginx container on deploy via --remove-orphans - #43

Merged
thom-techlete merged 2 commits into
mainfrom
copilot/update-deploy-flow-remove-orphans
Mar 4, 2026
Merged

thom-techlete merged 2 commits into
mainfrom
copilot/update-deploy-flow-remove-orphans

Conversation

Copilot AI commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

After switching from nginx to Caddy, the old rap-nginx-1 container persisted as an orphan, blocking Caddy from renewing SSL certificates.

Change

Added --remove-orphans to the docker compose up call in the test_deployment function of the CI/CD pipeline:

# Before
docker compose -f docker-compose.prod.yml up -d --no-deps web celery_worker celery_beat

# After
docker compose -f docker-compose.prod.yml up -d --no-deps --remove-orphans web celery_worker celery_beat

This ensures containers for services removed from the compose file (e.g. nginx) are cleaned up automatically on each deploy.

Original prompt

in last pr and deploy i switched from nginx to caddy. but nginx container is not cleaned up and still causes ssl certificate to not be renewed yet by caddy. Update deploy (ci/cd) flow to remove orphans when compose up.

logs:

err: time="2026-03-04T23:42:19+01:00" level=warning msg="Found orphan containers ([rap-nginx-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up."


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: thom-techlete <176420111+thom-techlete@users.noreply.github.com>
Copilot AI changed the title [WIP] Update deploy flow to remove orphan containers on compose up fix: remove orphaned nginx container on deploy via --remove-orphans Mar 4, 2026
@thom-techlete
thom-techlete marked this pull request as ready for review March 4, 2026 22:54
@thom-techlete
thom-techlete merged commit 322e9fc into main Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants