Docker security hardening with secrets management#111
Draft
Docker security hardening with secrets management#111
Conversation
…entation Co-authored-by: scubaninja <26086919+scubaninja@users.noreply.github.com>
…om warning Co-authored-by: scubaninja <26086919+scubaninja@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance Docker security hardening measures
Docker security hardening with secrets management
Nov 27, 2025
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.
Implements comprehensive Docker security hardening: secrets management, non-root users, capability dropping, resource limits, and health checks.
Changes
Security Context
no-new-privileges:trueto both containersNET_BIND_SERVICEfor node,CHOWN/SETGID/SETUID/DAC_OVERRIDE/FOWNERfor postgres)Non-root Users
nodeappuser in Node.js DockerfilepostgresuserSecrets Management
secrets/directory with example filesconfig.jsto read credentials from/run/secrets/*:Base Images
19.3.0-bullseye-slim→22-bookworm-slim15.1-bullseye→16-bookwormHealth Checks
curl -f http://localhost:3000/(30s interval, 10s timeout, 3 retries)pg_isready -U postgres(30s interval, 10s timeout, 5 retries, 30s start period)Documentation
SECURITY.mdwith setup instructions and best practicesREADME.mdwith secrets setup stepsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.