Containerize Product service (multi-stage build, /health & /ready, env config)#84
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Containerize Product service (multi-stage build, /health & /ready, env config)#84devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…y, env config, .dockerignore
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Makes the Product service container-ready: hardened multi-stage image, distinct liveness/readiness endpoints, and fully externalized configuration.
Health endpoints (
Program.cs) — replaced the single/healthzwith two:/health— liveness, no dependency checks (Predicate = _ => false), always 200 while the process is up./ready— readiness, runsAddDbContextCheck<ProductDbContext>taggedready; 200 when Postgres is reachable, 503 otherwise.Adds
Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCorefor the DB check.Config externalization — removed the hardcoded connection string from
appsettings.json(wasHost=localhost;...;Password=postgres); the connection string now comes only from env (ConnectionStrings__DefaultConnection). No hosts/credentials baked into the image.Dockerfile — multi-stage (SDK build → aspnet runtime), restore-then-copy layer caching, runs as the base image's non-root
$APP_UID, listens on8080viaASPNETCORE_HTTP_PORTS(no hardcoded URLs),ASPNETCORE_ENVIRONMENT=Productiondefault..dockerignore(build contextsrc/) — excludesbin/,obj/,.git/, IDE files, Dockerfiles, and local/secret config.docker-compose.ymlproduct-service updated to map5004:8080and setASPNETCORE_HTTP_PORTS.Verification
Companion Helm changes: quickapp-iac product-service chart (
/health+/readyprobes, env/secret config).Note: the pre-existing
Shared.*project-reference warning is unchanged by this PR.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/3d95e4a548134c9e9f8ee60fd2657ba0
Requested by: @mbatchelor81