2024-06-30 04:07:12 +02:00
|
|
|
FROM python:3.11-slim AS base
|
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
|
2024-06-30 04:07:12 +02:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
ENV APPRISE_CONFIG_DIR=/config
|
|
|
|
ENV APPRISE_ATTACH_DIR=/attach
|
|
|
|
ENV APPRISE_PLUGIN_PATHS=/plugin
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2024-06-30 04:07:12 +02:00
|
|
|
FROM base AS runtime
|
2023-09-02 21:06:22 +02:00
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Install requirements and gunicorn
|
|
|
|
COPY ./requirements.txt /etc/requirements.txt
|
2024-12-27 23:57:27 +01:00
|
|
|
|
2023-11-15 03:46:03 +01:00
|
|
|
RUN set -eux && \
|
|
|
|
echo "Installing nginx" && \
|
|
|
|
apt-get update -qq && \
|
|
|
|
apt-get install -y -qq \
|
|
|
|
nginx && \
|
2024-06-30 04:07:12 +02:00
|
|
|
echo "Installing tools" && \
|
|
|
|
apt-get install -y -qq \
|
2024-09-03 04:34:27 +02:00
|
|
|
curl sed git && \
|
|
|
|
echo "Installing python requirements" && \
|
|
|
|
pip3 install --no-cache-dir -q -r /etc/requirements.txt gunicorn supervisor && \
|
2024-12-27 23:57:27 +01:00
|
|
|
pip freeze && \
|
2023-11-15 03:46:03 +01:00
|
|
|
echo "Cleaning up" && \
|
|
|
|
apt-get --yes autoremove --purge && \
|
|
|
|
apt-get clean --yes && \
|
|
|
|
rm --recursive --force --verbose /var/lib/apt/lists/* && \
|
|
|
|
rm --recursive --force --verbose /tmp/* && \
|
|
|
|
rm --recursive --force --verbose /var/tmp/* && \
|
|
|
|
rm --recursive --force --verbose /var/cache/apt/archives/* && \
|
|
|
|
truncate --size 0 /var/log/*log
|
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
|
|
|
|
|
2024-06-30 04:07:12 +02:00
|
|
|
# Configuration Permissions (to run nginx as a non-root user)
|
2021-10-30 22:58:15 +02:00
|
|
|
RUN umask 0002 && \
|
2024-06-30 04:07:12 +02:00
|
|
|
touch /etc/nginx/server-override.conf && \
|
|
|
|
touch /etc/nginx/location-override.conf
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2021-10-30 22:58:15 +02:00
|
|
|
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
|
2024-06-30 04:07:12 +02:00
|
|
|
CMD ["/opt/apprise/webapp/supervisord-startup"]
|