add UID&GID support to Dockerfile

This commit is contained in:
Gergely Hegedis 2024-10-04 20:59:00 +03:00 committed by GitHub
parent a4c68ca9e2
commit 6a64a943b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,8 @@
FROM python:3.9-bullseye
ARG UID=1000
ARG GID=1000
# ENV setup
RUN ["python","--version"]
RUN ["apt-get", "update"]
@ -11,7 +14,8 @@ RUN ["pip", "install", "firebase_admin"]
RUN ["pip", "install", "pycryptodome"]
RUN ["pip", "install", "watchdog"]
RUN adduser --system --no-create-home flask
RUN groupadd -g $GID -o flask
RUN adduser -u $UID -g $GID --no-create-home flask
USER flask
WORKDIR /home/flask/server