2020-08-30 23:30:17 +02:00
|
|
|
ARG ARCH
|
|
|
|
FROM ${ARCH}python:3.8-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
|
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Install requirements and gunicorn
|
|
|
|
COPY ./requirements.txt /etc/requirements.txt
|
|
|
|
RUN pip3 install -r /etc/requirements.txt gunicorn
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Install nginx and supervisord
|
2020-01-03 05:24:07 +01:00
|
|
|
RUN apt-get update && \
|
2020-08-30 23:30:17 +02:00
|
|
|
apt-get install -y nginx supervisor
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Nginx configuration
|
|
|
|
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
|
|
|
|
COPY /etc/nginx.conf /etc/nginx/conf.d/nginx.conf
|
2020-01-03 05:24:07 +01:00
|
|
|
|
|
|
|
# Copy our static content in place
|
|
|
|
COPY apprise_api/static /usr/share/nginx/html/s/
|
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Supervisor configuration
|
|
|
|
COPY /etc/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
2020-01-03 05:24:07 +01:00
|
|
|
|
2020-01-03 15:30:54 +01:00
|
|
|
# set work directory
|
|
|
|
WORKDIR /opt/apprise
|
|
|
|
|
|
|
|
# Copy over Apprise API
|
|
|
|
COPY apprise_api/ webapp
|
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
# Change port of gunicorn
|
|
|
|
RUN sed -i -e 's/:8000/:8080/g' /opt/apprise/webapp/gunicorn.conf.py
|
2020-01-03 05:24:07 +01:00
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
VOLUME /config
|
|
|
|
|
2020-08-30 23:30:17 +02:00
|
|
|
CMD ["/usr/bin/supervisord"]
|