Commit b6f0d9a
fix(docker): run container as non-root user (least privilege)
No USER directive meant uvicorn ran as root (uid 0). Add an
unprivileged `appuser` (uid 10001) and switch to it before CMD. The
app binds 8000 (>1024) so root isn't needed; app files stay root-owned
and read-only to appuser. Verified the image runs as uid 10001 and
/api/MarkAccent/ still returns 200.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 432af8b commit b6f0d9a
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
0 commit comments