Skip to content

Commit 5254a95

Browse files
non root user added in docerfile (#4098)
1 parent 0cd0e74 commit 5254a95

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ FROM python:latest AS build
33

44
WORKDIR /app
55

6+
RUN useradd -m appuser
7+
68
COPY . .
79

810
# Second stage: Final stage
911
FROM python:latest
1012

13+
RUN useradd -m appuser
14+
1115
WORKDIR /app
1216

1317
COPY --from=build /app /app
1418

19+
USER appuser
20+
1521
EXPOSE 3000
1622

17-
CMD ["python", "-m", "http.server", "3000", "--bind", "0.0.0.0"]
23+
CMD ["python", "-m", "http.server", "3000", "--bind", "0.0.0.0"]

0 commit comments

Comments
 (0)