Skip to content

Commit 127e247

Browse files
committed
Add non-root image user
1 parent c798ab1 commit 127e247

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ RUN pip install --upgrade pip && \
3939

4040
FROM docker.io/library/python:3.13.1-slim-bookworm as runtime
4141

42+
RUN adduser --system --no-create-home --uid 1001 nonroot
43+
4244
# copy the virtual environment from the build stage and put it in PATH
4345
COPY --from=build /venv/ /venv/
4446
ENV PATH=/venv/bin:$PATH
4547

4648
COPY alembic.ini /alembic/
4749
COPY alembic/ /alembic/alembic
4850

51+
# Must be number to pass non-root check
52+
USER 1001
53+
4954
# change this entrypoint if it is not the same as the repo
5055
ENTRYPOINT ["uvicorn"]
5156
CMD ["scaup.main:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)