Add application user

This commit is contained in:
Eden Kirin
2024-01-12 10:29:26 +01:00
parent 10966f3c1f
commit 4c20c41426
5 changed files with 30 additions and 7 deletions

View File

@ -23,6 +23,11 @@ RUN \
FROM python:3.11-slim-bookworm
# uid to run application
ARG USER=1000
# gid to run application
ARG USER_GROUP=1000
# set virtual env path
ENV \
PATH=/venv/bin:$PATH
@ -38,11 +43,11 @@ COPY --from=install-dependencies /venv /venv
# copy app files to /app directory
COPY ./app .
RUN ls -alF /
RUN ls -alF /venv
RUN ls -alF /venv/bin
RUN ls -alF /app
# set permissions to log directory
RUN chown -R ${USER}:${USER_GROUP} /app/log
# set user to run application
USER ${USER}:${USER_GROUP}
# start shell script when container starts
ENTRYPOINT ["/app/run.sh"]