Docker Compose template: Improve secrets handling and add script to trust development certificates#22613
Conversation
|
Claude finished @nikolajlauridsen's task in 2m 3s —— View job PR ReviewTarget: Replaces the hardcoded
Suggestions
ApprovedClean, minimal change. Template replacement chain is correct: the |
There was a problem hiding this comment.
Pull request overview
Updates the Docker Compose and Dockerfile templates to avoid a hard-coded dev certificate password by generating a per-project GUID-based password at template creation time and wiring it through the build/runtime configuration.
Changes:
- Introduce a
CERT_PASSWORDbuild-arg in the project Dockerfile and use it when exporting the generatedaspnetcore.pfx. - Pass
CERT_PASSWORDinto the image build viadocker-compose.ymland use it at runtime for Kestrel certificate loading. - Generate a GUID-based
CERT_PASSWORDin the compose template and populate it into the generated.env.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| templates/UmbracoProject/Dockerfile | Uses a CERT_PASSWORD build-arg for the generated dev HTTPS certificate export. |
| templates/UmbracoDockerCompose/docker-compose.yml | Threads CERT_PASSWORD through build args and runtime Kestrel certificate configuration. |
| templates/UmbracoDockerCompose/.template.config/template.json | Adds a generated GUID symbol to replace the cert password placeholder. |
| templates/UmbracoDockerCompose/.env | Adds CERT_PASSWORD placeholder to be replaced by the generated GUID. |
The self-signed certificate is now generated at container startup (on first run) rather than at image build time. This makes the
.crtfile available on the host via a./certsbind mount, wheretrust-cert.sh/trust-cert.ps1can install it into the OS trust store to eliminate browser HTTPS warnings.The hardcoded
DevOnlyPasswordfor the certificate has been replaced with a per-instance generated password, and the ImageSharp HMAC secret key is now also generated at template instantiation time and injected via environment variable — bypassing the install-time write toappsettings.jsonwhich fails in Docker containers.Already tested locally.