2024-02-05 16:33:14 +00:00
|
|
|
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
|
|
|
|
2024-02-05 16:33:14 +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
|
2024-02-05 16:33:14 +00:00
|
|
|
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
|
|
|
|
2024-02-05 16:33:14 +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
|
|
|
|
VOLUME /etc/wmn/config.yml
|
|
|
|
ENV WMN_CONFIG_PATH=/etc/wmn/config.yml
|
2024-02-05 16:33:14 +00:00
|
|
|
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
|
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", \
|
2024-02-05 16:33:14 +00:00
|
|
|
"--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", \
|
2024-02-05 16:33:14 +00:00
|
|
|
"--processes", "2", \
|
2019-07-19 14:16:48 +00:00
|
|
|
"--threads", "2" ]
|