Skip to content

chore(docker): run the container as a non-root user - #34

Merged
abhay-codes07 merged 1 commit into
mainfrom
chore/docker-nonroot
Sep 5, 2026
Merged

chore(docker): run the container as a non-root user#34
abhay-codes07 merged 1 commit into
mainfrom
chore/docker-nonroot

Conversation

@abhay-codes07

Copy link
Copy Markdown
Owner

Hugging Face Spaces run the image as uid 1000, so the writable runtime dir must be owned by that user. Adds a uid-1000 app user, chowns /app, drops to it before CMD — also closes the P3 'Dockerfile runs as root' hardening note. Verified locally: image builds, boots, serves console + API, writes data/runtime as non-root with no errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks

Hugging Face Spaces run the image as uid 1000, so the runtime dir the app
writes to (audit log, LLM cache) must be owned by that user; this also
closes the P3 "Dockerfile runs as root" hardening note. Adds a uid-1000
`app` user, chowns /app, and drops to it before CMD. Verified: the image
builds and boots, serves the console and API, and writes data/runtime as
the non-root user with no permission errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks
Copilot AI lite review requested due to automatic review settings September 5, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abhay-codes07
abhay-codes07 merged commit b0c3c1f into main Sep 5, 2026
2 checks passed
@abhay-codes07
abhay-codes07 deleted the chore/docker-nonroot branch September 5, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants