Skip to content

Deploy: remove orphaned containers on compose up - #34

Open
secoro wants to merge 1 commit into
mainfrom
ci/compose-remove-orphans
Open

Deploy: remove orphaned containers on compose up#34
secoro wants to merge 1 commit into
mainfrom
ci/compose-remove-orphans

Conversation

@secoro

@secoro secoro commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Why

The v1.4.0 deploy failed at checkout with `EACCES: permission denied, rmdir .../backend/deploy/Caddyfile`.

Root cause: when Caddy was removed from the repo (3073111), `docker compose up` left the old `onsinventory-caddy` container behind — compose does not remove services that disappeared from the compose file unless `--remove-orphans` is passed. That container bind-mounted `./deploy/Caddyfile` from the runner workspace; after the file was deleted from git, the Docker daemon recreated the missing mount source as a root-owned directory on container restart, which the runner user can't delete during checkout cleanup.

The one-off cleanup already ran successfully (run 29204400052, dispatched from `debug/clean-caddy-leftovers`): it removed the orphaned container and the root-owned directory, and the deploy went through.

What

Add `--remove-orphans` to the deploy's `docker compose up` so removed services are cleaned up on every deploy and this can't recur.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.51%. Comparing base (f56872e) to head (ebe82b9).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##               main      #34   +/-   ##
=========================================
  Coverage     29.51%   29.51%           
  Complexity      133      133           
=========================================
  Files            54       54           
  Lines          1738     1738           
  Branches        321      321           
=========================================
  Hits            513      513           
  Misses         1170     1170           
  Partials         55       55           
Flag Coverage Δ
backend 55.53% <ø> (ø)
frontend 2.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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