2021-06-28 08:39:37 +00:00
|
|
|
FROM docker.io/alpine:latest
|
|
|
|
MAINTAINER Benedikt Ziemons <ben@rs485.network>
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-10-28 21:22:28 +00:00
|
|
|
RUN apk add --no-cache uwsgi-python3 python3 py3-yaml py3-pip py3-setuptools py3-matrix-nio py3-dateutil && \
|
|
|
|
pip install -U pip && \
|
|
|
|
pip install -U setuptools && \
|
|
|
|
pip install -U Flask[async]
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-10-28 20:58:37 +00:00
|
|
|
# copy required source files
|
|
|
|
COPY wmn/ /usr/local/lib/wmn/wmn
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-10-28 20:58:37 +00:00
|
|
|
ARG WMN_UID=1000
|
|
|
|
ARG WMN_GID=1000
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-10-28 20:58:37 +00:00
|
|
|
RUN mkdir -p /etc/wmn && \
|
|
|
|
chmod 0700 /etc/wmn && \
|
|
|
|
chown "${WMN_UID}" /etc/wmn && \
|
|
|
|
addgroup -g "${WMN_GID}" wmn && \
|
|
|
|
adduser -s /bin/sh -u "${WMN_UID}" -G wmn -D wmn
|
2021-06-28 08:39:37 +00:00
|
|
|
|
2021-10-28 20:58:37 +00:00
|
|
|
USER wmn
|
|
|
|
VOLUME /etc/wmn/config.yml
|
|
|
|
ENV WMN_CONFIG_PATH=/etc/wmn/config.yml
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-06-28 08:39:37 +00:00
|
|
|
ARG PORT=3031
|
|
|
|
EXPOSE $PORT
|
2021-06-29 11:02:25 +00:00
|
|
|
ENV UWSGI_SOCKET=:$PORT
|
2019-07-19 14:16:48 +00:00
|
|
|
|
2021-06-28 08:39:37 +00:00
|
|
|
# opens a uwsgi socket at the given port, which is to be used by a reverse proxy
|
2019-07-19 14:16:48 +00:00
|
|
|
CMD [ "uwsgi", "--die-on-term", \
|
|
|
|
"--need-plugin", "python3", \
|
2021-10-28 20:58:37 +00:00
|
|
|
"--module", "wmn.wmn", \
|
|
|
|
"--pythonpath", "/usr/local/lib/wmn", \
|
2019-07-19 14:16:48 +00:00
|
|
|
"--master", \
|
|
|
|
"--processes", "1", \
|
|
|
|
"--threads", "2" ]
|