Skip to content

fix(infra): retain deployment images and rotate container logs - #241

Merged
mirror29 merged 3 commits into
mainfrom
codex/disk-retention-and-log-rotation
Oct 14, 2026
Merged

mirror29 merged 3 commits into
mainfrom
codex/disk-retention-and-log-rotation

Conversation

@mirror29

@mirror29 mirror29 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Production deployments accumulated old Docker images until the system disk reached 89% usage. Add post-deployment cleanup after Compose health checks pass, retaining the two newest builds per application repository, all container references, pre-deployment images, and images less than 24 hours old. Docker timestamp fractions are normalized for older Python hosts. Cleanup defaults to a dry run and never removes containers or volumes.

Bound every production container's JSON logs to three 10 MB files. Document retention, manual previews, and the need to recreate containers for logging changes to take effect.

Validation

  • 12 unit and deployment-flow tests passed; wired into CI.
  • Ruff, Bash syntax, and diff whitespace checks passed.
  • Repository consistency: 19 passed, 0 failures (existing warnings).
  • Production Compose rendering verified: logging is the only effective service configuration change.
  • Production cleanup dry run passed; independent pre-landing review found no blocking issues.

Deployment

Deployed merge commit 0319b57d to production. All 11 containers have json-file logging with max-size=10m and max-file=3; image IDs, environments, commands, and data mounts were verified unchanged. The 10 long-running services are up, all configured health checks pass, and the three running strategies retain their running state. The migration container was recreated without running migrations.

A disposable container emitted 45 MB of output and retained only three rotated log files; the test container was then removed. Image cleanup removed one eligible old image while protecting current containers and pre-deployment references. The system disk has approximately 32 GB available. All PR checks passed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying inalpha-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 847bbfb
Status: ✅  Deploy successful!
Preview URL: https://5c3740b9.inalpha-web.pages.dev
Branch Preview URL: https://codex-disk-retention-and-log.inalpha-web.pages.dev

View logs

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Reviewed PR head: 847bbfb7870d

🤖 DeepSeek V4 Pro PR Review

⚠️ Review could not be completed: DeepSeek API request failed: DeepSeek did not return a publishable review

@mirror29
mirror29 merged commit 0319b57 into main Oct 14, 2026
15 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.

1 participant