FROM docker.io/archlinux/archlinux:base MAINTAINER Benedikt Ziemons RUN pacman -Syu --noconfirm python python-pipenv python-setuptools uwsgi uwsgi-plugin-python && \ rm -rf /var/cache/pacman && \ mkdir /opt/webhook-matrix-notifier # copy required source files COPY Pipfile Pipfile.lock pyproject.toml LICENSE /opt/webhook-matrix-notifier/ COPY wmn/ /opt/webhook-matrix-notifier/wmn/ ARG WMN_UID=1000 ARG WMN_GID=1000 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 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 ARG PORT=3031 EXPOSE $PORT ENV UWSGI_SOCKET=:$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", "python", \ "--virtualenv", "/opt/webhook-matrix-notifier/.venv", \ "--pythonpath", "/opt/webhook-matrix-notifier", \ "--module", "wmn.wsgi", \ "--master", \ "--processes", "2", \ "--threads", "2" ]