From fd10a957c96a517b51d4efae5e43093329298d0c Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Mon, 28 Jun 2021 10:39:37 +0200 Subject: [PATCH] Fix/Update Dockerfile --- Dockerfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0cfbb63..558c018 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,31 @@ -FROM alpine +FROM docker.io/alpine:latest +MAINTAINER Benedikt Ziemons RUN apk add --no-cache uwsgi-python3 python3 py3-yaml py3-flask py3-matrix-nio # partly from https://hub.docker.com/_/python?tab=description#create-a-dockerfile-in-your-python-app-project WORKDIR /usr/src/wmn -COPY requirements.txt ./ -RUN pip3 install --no-cache-dir -r requirements.txt -# copy required source files +# copy required source file COPY wmn.py ./ WORKDIR /run/wmn + +ARG WMN_UID=999 + # requires config.yml to be present at build COPY config.yml ./ -RUN chown -R 999 /run/wmn && chmod 0600 /run/wmn/config.yml +RUN chown -R $WMN_UID /run/wmn && chmod 0600 /run/wmn/config.yml -USER 999 +USER $WMN_UID -# opens a uwsgi socket at port 3031, which is to be used by a reverse proxy +ARG PORT=3031 +EXPOSE $PORT + +# opens a uwsgi socket at the given port, which is to be used by a reverse proxy CMD [ "uwsgi", "--die-on-term", \ "--need-plugin", "python3", \ - "--socket", "0.0.0.0:3031", \ + "--socket", "0.0.0.0:${PORT}", \ "--wsgi-file", "/usr/src/wmn/wmn.py", \ "--master", \ "--processes", "1", \