Skip to content

Commit

Permalink
Fixed Rust Build on latest Ubuntu (cryptography dep) (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed May 16, 2023
1 parent 6cf3a28 commit 0f30127
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV APPRISE_CONFIG_DIR /config
ENV APPRISE_ATTACH_DIR /attach
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
ENV APPRISE_PLUGIN_PATHS /plugin

# Install nginx and supervisord
RUN apt-get update -qq && \
apt-get install -y -qq nginx supervisor build-essential libffi-dev libssl-dev python-dev
apt-get install -y -qq nginx supervisor build-essential libffi-dev libssl-dev \
pkg-config python-dev rustc

# Install requirements and gunicorn
COPY ./requirements.txt /etc/requirements.txt
Expand All @@ -32,19 +33,20 @@ WORKDIR /opt/apprise
COPY apprise_api/ webapp

# Cleanup
RUN apt-get remove -y -qq build-essential libffi-dev libssl-dev python-dev && \
RUN apt-get remove -y -qq build-essential libffi-dev libssl-dev python-dev rustc 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)
RUN umask 0002 && \
mkdir -p /attach /config /run/apprise && \
chown www-data:www-data -R /run/apprise /var/lib/nginx /attach /config
mkdir -p /attach /config /plugin /run/apprise && \
chown www-data:www-data -R /run/apprise /var/lib/nginx /attach /config /plugin

# Handle running as a non-root user (www-data is id/gid 33)
USER www-data
VOLUME /config
VOLUME /attach
VOLUME /plugin
EXPOSE 8000
CMD ["/usr/bin/supervisord", "-c", "/opt/apprise/webapp/etc/supervisord.conf"]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
django
apprise == 1.4.0
gunicorn

# 3rd party service support
paho-mqtt
Expand Down

0 comments on commit 0f30127

Please sign in to comment.