From 6a64a943b1562268827f656ed1f45b4ada55bf96 Mon Sep 17 00:00:00 2001 From: Gergely Hegedis Date: Fri, 4 Oct 2024 20:59:00 +0300 Subject: [PATCH] add UID&GID support to Dockerfile --- server/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index e7fda6a..0a65aa4 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -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 @@ -19,4 +23,4 @@ WORKDIR /home/flask/server # load source files COPY ./application /home/flask/server -CMD uwsgi --ini notification-service.ini --touch-reload=notification-service.ini \ No newline at end of file +CMD uwsgi --ini notification-service.ini --touch-reload=notification-service.ini