webhook-matrix-notifier/Dockerfile

45 lines
1.4 KiB
Docker
Raw Normal View History

FROM docker.io/archlinux/archlinux:base
2021-06-28 08:39:37 +00:00
MAINTAINER Benedikt Ziemons <ben@rs485.network>
2019-07-19 14:16:48 +00:00
RUN pacman -Syu --noconfirm python python-pipenv python-setuptools uwsgi uwsgi-plugin-python && \
rm -rf /var/cache/pacman && \
mkdir /opt/webhook-matrix-notifier
2019-07-19 14:16:48 +00:00
2021-10-28 20:58:37 +00:00
# copy required source files
COPY Pipfile Pipfile.lock pyproject.toml LICENSE /opt/webhook-matrix-notifier/
COPY wmn/ /opt/webhook-matrix-notifier/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
RUN groupadd -g "${WMN_GID}" wmn && \
useradd -u "${WMN_UID}" -g "${WMN_GID}" -m wmn && \
mkdir -p /etc/wmn && \
chmod 0750 /etc/wmn && \
chown "${WMN_UID}:${WMN_GID}" /etc/wmn && \
chown -R "${WMN_UID}:${WMN_GID}" /opt/webhook-matrix-notifier
2021-06-28 08:39:37 +00:00
2021-10-28 20:58:37 +00:00
USER wmn
ARG WMN_CONFIG_PATH=/etc/wmn/config.yml
ENV WMN_CONFIG_PATH=$WMN_CONFIG_PATH
WORKDIR /opt/webhook-matrix-notifier
ENV PIPENV_VENV_IN_PROJECT=1
ARG PIPENV_SITE_PACKAGES=1
RUN pipenv install --deploy
2019-07-19 14:16:48 +00:00
2021-06-28 08:39:37 +00:00
ARG PORT=3031
EXPOSE $PORT
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", "python", \
"--virtualenv", "/opt/webhook-matrix-notifier/.venv", \
"--pythonpath", "/opt/webhook-matrix-notifier", \
"--module", "wmn.wsgi", \
2019-07-19 14:16:48 +00:00
"--master", \
"--processes", "2", \
2019-07-19 14:16:48 +00:00
"--threads", "2" ]