Repository navigation
fix(infra): retain deployment images and rotate container logs - #241
Merged
Merged
Conversation
Deploying inalpha-web with
|
| 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 |
|
Reviewed PR head: 🤖 DeepSeek V4 Pro PR Review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Deployment
Deployed merge commit
0319b57dto production. All 11 containers havejson-filelogging withmax-size=10mandmax-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.