add UID&GID support to Dockerfile
This commit is contained in:
parent
a4c68ca9e2
commit
6a64a943b1
1 changed files with 6 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
FROM python:3.9-bullseye
|
FROM python:3.9-bullseye
|
||||||
|
|
||||||
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
|
|
||||||
# ENV setup
|
# ENV setup
|
||||||
RUN ["python","--version"]
|
RUN ["python","--version"]
|
||||||
RUN ["apt-get", "update"]
|
RUN ["apt-get", "update"]
|
||||||
|
|
@ -11,7 +14,8 @@ RUN ["pip", "install", "firebase_admin"]
|
||||||
RUN ["pip", "install", "pycryptodome"]
|
RUN ["pip", "install", "pycryptodome"]
|
||||||
RUN ["pip", "install", "watchdog"]
|
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
|
USER flask
|
||||||
|
|
||||||
WORKDIR /home/flask/server
|
WORKDIR /home/flask/server
|
||||||
|
|
@ -19,4 +23,4 @@ WORKDIR /home/flask/server
|
||||||
# load source files
|
# load source files
|
||||||
COPY ./application /home/flask/server
|
COPY ./application /home/flask/server
|
||||||
|
|
||||||
CMD uwsgi --ini notification-service.ini --touch-reload=notification-service.ini
|
CMD uwsgi --ini notification-service.ini --touch-reload=notification-service.ini
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue