webhook-matrix-notifier/Dockerfile

33 lines
904 B
Docker
Raw Normal View History

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
RUN apk add --no-cache uwsgi-python3 python3 py3-yaml py3-flask py3-matrix-nio
2019-07-19 14:16:48 +00:00
# partly from https://hub.docker.com/_/python?tab=description#create-a-dockerfile-in-your-python-app-project
WORKDIR /usr/src/wmn
2021-06-28 08:39:37 +00:00
# copy required source file
2019-07-19 14:16:48 +00:00
COPY wmn.py ./
WORKDIR /run/wmn
2021-06-28 08:39:37 +00:00
ARG WMN_UID=999
2019-07-19 14:16:48 +00:00
# requires config.yml to be present at build
COPY config.yml ./
2021-06-28 08:39:37 +00:00
RUN chown -R $WMN_UID /run/wmn && chmod 0600 /run/wmn/config.yml
USER $WMN_UID
2019-07-19 14:16:48 +00:00
2021-06-28 08:39:37 +00:00
ARG PORT=3031
EXPOSE $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-06-28 08:39:37 +00:00
"--socket", "0.0.0.0:${PORT}", \
2019-07-19 14:16:48 +00:00
"--wsgi-file", "/usr/src/wmn/wmn.py", \
"--master", \
"--processes", "1", \
"--threads", "2" ]