Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,31 @@ ENV APPRISE_ATTACH_DIR=/attach
ENV APPRISE_PLUGIN_PATHS=/plugin
ENV TZ=Etc/UTC

FROM base AS builder

# python-qpid-proton (AMQP 1.0) is installed here rather than through
# requirements.txt because it must be compiled on Linux
COPY ./requirements.txt /etc/requirements.txt

RUN set -eux && \
echo "Installing build tools" && \
apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
build-essential pkg-config libssl-dev git && \
echo "Building python wheels" && \
pip3 wheel --no-cache-dir -q --wheel-dir /wheels \
-r /etc/requirements.txt gunicorn supervisor \
python-qpid-proton

FROM base AS runtime

# Install requirements and gunicorn
COPY ./requirements.txt /etc/requirements.txt

RUN set -eux && \
# The wheels from the builder are only mounted while installing, so they
# do not take up space in the final image
RUN --mount=type=bind,from=builder,source=/wheels,target=/wheels \
set -eux && \
echo "Installing nginx" && \
apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
Expand All @@ -29,7 +48,9 @@ RUN set -eux && \
apt-get install -y -qq \
curl sed git && \
echo "Installing python requirements" && \
pip3 install --no-cache-dir -q -r /etc/requirements.txt gunicorn supervisor && \
pip3 install --no-cache-dir -q --no-index --find-links /wheels \
-r /etc/requirements.txt gunicorn supervisor \
python-qpid-proton && \
pip freeze && \
echo "Cleaning up" && \
apt-get --yes autoremove --purge && \
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ dependencies = [
"PGPy",
"smpplib",
"slixmpp >= 1.16.0",
# Provides amqp:// support for AMQP 0.9.1
"pika",
]

[project.urls]
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ PGPy
smpplib
# For xmpp:// support
slixmpp >= 1.16.0
# Provides amqp:// support for AMQP 0.9.1
pika
# AMQP 1.0 (python-qpid-proton) must be compiled on Linux, so only the
# Docker image installs it. Add it with: pip install python-qpid-proton

# prometheus metrics
django-prometheus
Loading