fix: right-size resource limits for free-tier hosts, consolidate app into single container#13
Merged
Merged
Conversation
Previous deploy.resources.limits summed to ~2.5x the physical RAM on both target hosts (management: AWS t3.small 2GB, app: Google Cloud e2-micro 1GB). Revised every stack's memory/cpu limits down to realistic usage, and gave jenkins an explicit JVM heap percentage so it scales off the container's cgroup limit instead of assuming host RAM. Added swap provisioning to scripts/harden-host.sh (1G management, 512M app/agent) as a safety net against worst-case simultaneous memory peaks - not a substitute for right-sized limits, insurance against them anyway.
The real application builds one image, not two: a 3-stage Dockerfile (Next.js static export -> .NET publish -> export copied into the API's wwwroot) ships one ASP.NET Core process serving both frontend and API. docker/app/docker-compose.yml, nginx/app.conf's routing, and every doc describing the old two-container split are updated to match. Also replaces WEB_IMAGE_TAG/API_IMAGE_TAG with a single, required APP_IMAGE_NAME (no default) - this repo isn't tied to one project's naming - and fixes aws.md/google-cloud.md instance-sizing guidance, which still referenced pre-revision resource totals and recommended larger instances than the actual free-tier hosts this repo targets. Frees ~220M on the already-tight app host as a side effect.
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.
Two related but distinct changes, kept as separate commits:
fix: right-size resource limits for free-tier hosts, add swap safety net
Previous
deploy.resources.limitssummed to ~2.5x the physical RAM on bothtarget hosts (management: AWS t3.small 2GB, app: Google Cloud e2-micro 1GB).
Revised every stack's memory/cpu limits down to realistic usage, and gave
Jenkins an explicit JVM heap percentage so it scales off the container's
cgroup limit instead of assuming host RAM.
Added swap provisioning to scripts/harden-host.sh (1G management, 512M
app/agent) as a safety net against worst-case simultaneous memory peaks -
not a substitute for right-sized limits, insurance against them anyway.
Also fixes docs/platforms/aws.md, which still recommended a larger instance
than the actual free-tier target and referenced stale totals.
refactor: consolidate app's nextjs+dotnet-api into a single container
The real application builds one image, not two: a 3-stage Dockerfile
(Next.js static export -> .NET publish -> export copied into the API's
wwwroot) ships one ASP.NET Core process serving both frontend and API.
docker/app/docker-compose.yml, nginx/app.conf's routing, and every doc
describing the old two-container split are updated to match.
Also replaces WEB_IMAGE_TAG/API_IMAGE_TAG with a single, required
APP_IMAGE_NAME (no default) - this repo isn't tied to one project's
naming - and fixes docs/platforms/google-cloud.md's stale instance-sizing
guidance.
Frees ~220M on the already-tight app host as a side effect.
Test plan