2020-08-30 23:30:17 +02:00
|
|
|
ARG ARCH
|
2023-07-07 03:38:15 +02:00
|
|
|
FROM ${ARCH}python:3.11-slim
|
2020-01-03 05:24:07 +01:00
|
|
|
|
|
|
|
# set version label
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VERSION
|
|
|
|
LABEL build_version="Apprise API version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
|
|
LABEL maintainer="Chris-Caron"
|
|
|
|
|
|
|
|
# set environment variables
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
ENV APPRISE_CONFIG_DIR /config
|
2023-05-15 23:10:15 +02:00
|
|
|
ENV APPRISE_ATTACH_DIR /attach
|
2023-05-16 20:47:19 +02:00
|
|
|
ENV APPRISE_PLUGIN_PATHS /plugin
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2023-07-07 03:38:15 +02:00
|
|
|
# Install nginx, supervisord, and cryptography dependencies
|
2021-02-24 01:00:32 +01:00
|
|
|
RUN apt-get update -qq && \
|
2023-09-02 21:06:22 +02:00
|
|
|
apt-get install -y -qq nginx supervisor git curl \
|
|
|
|
build-essential libffi-dev libssl-dev pkg-config python3-dev
|
2023-07-07 03:38:15 +02:00
|
|
|
|
|
|
|
# Cryptography documents that the latest version of pip3 must always be used
|
|
|
|
RUN pip3 install --upgrade pip
|
2021-02-24 01:00:32 +01:00
|
|
|
|
2023-09-02 21:06:22 +02:00
|
|
|
# Pull in bleeding edge of rust to keep up with cryptography build requirements
|
|
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Install requirements and gunicorn
|
|
|
|
COPY ./requirements.txt /etc/requirements.txt
|
2023-09-02 21:06:22 +02:00
|
|
|
RUN . "$HOME/.cargo/env" && pip3 install --no-cache-dir -q -r /etc/requirements.txt gunicorn --no-binary cryptography
|
2020-01-03 05:24:07 +01:00
|
|
|
|
|
|
|
# Copy our static content in place
|
|
|
|
COPY apprise_api/static /usr/share/nginx/html/s/
|
|
|
|
|
2020-01-03 15:30:54 +01:00
|
|
|
# set work directory
|
|
|
|
WORKDIR /opt/apprise
|
|
|
|
|
|
|
|
# Copy over Apprise API
|
|
|
|
COPY apprise_api/ webapp
|
|
|
|
|
2021-02-24 01:00:32 +01:00
|
|
|
# Cleanup
|
2023-09-02 21:06:22 +02:00
|
|
|
RUN . "$HOME/.cargo/env" && rustup self uninstall -y && \
|
|
|
|
apt-get remove -y -qq curl build-essential libffi-dev libssl-dev python3-dev pkg-config && \
|
|
|
|
apt-get clean autoclean && \
|
|
|
|
apt-get autoremove --yes && \
|
|
|
|
rm -rf /var/lib/{apt,dpkg,cache,log}/
|
|
|
|
#
|
|
|
|
# # Configuration Permissions (to run nginx as a non-root user)
|
2021-10-30 22:58:15 +02:00
|
|
|
RUN umask 0002 && \
|
2023-05-16 20:47:19 +02:00
|
|
|
mkdir -p /attach /config /plugin /run/apprise && \
|
|
|
|
chown www-data:www-data -R /run/apprise /var/lib/nginx /attach /config /plugin
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2021-10-30 22:58:15 +02:00
|
|
|
# Handle running as a non-root user (www-data is id/gid 33)
|
|
|
|
USER www-data
|
|
|
|
VOLUME /config
|
2023-05-15 23:10:15 +02:00
|
|
|
VOLUME /attach
|
2023-05-16 20:47:19 +02:00
|
|
|
VOLUME /plugin
|
2021-10-30 22:58:15 +02:00
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/opt/apprise/webapp/etc/supervisord.conf"]
|