We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1170355 commit a721034Copy full SHA for a721034
1 file changed
src/backend/Dockerfile
@@ -27,8 +27,12 @@ FROM python:3.14-alpine
27
# Python executable must be the same, e.g., using `python:3.11-slim-bookworm`
28
# will fail.
29
30
-# Copy the application from the builder
31
-COPY --from=builder --chown=app:app /app /app
+## Create a non-root user and group for running the application
+RUN addgroup -S chithi \
32
+ && adduser -S -G chithi -h /app -s /bin/sh chithi
33
+
34
+# Copy the application from the builder and make it owned by the chithi user
35
+COPY --from=builder --chown=chithi:chithi /app /app
36
37
# Place executables in the environment at the front of the path
38
ENV PATH="/app/.venv/bin:$PATH"
@@ -37,3 +41,7 @@ ENV HOST=127.0.0.1
41
ENV PORT=8000
42
EXPOSE 8000/udp 8000/tcp
39
43
44
+# Use a non-root user
45
+WORKDIR /app
46
+USER chithi
47
0 commit comments