nginx-certbot/src/Dockerfile

34 lines
1.2 KiB
Docker

FROM nginx
#LABEL maintainer="Elliot Saba <staticfloat@gmail.com>, Valder Gallo <valergallo@gmail.com>, Bruno Zell <bruno.zzell@gmail.com>"
LABEL maintainer="Giles Bradshaw <giles.bradshaw@sigyl.com>"
VOLUME /etc/letsencrypt
EXPOSE 80
EXPOSE 443
# Do this apt/pip stuff all in one RUN command to avoid creating large
# intermediate layers on non-squashable docker installs
RUN apt update && \
apt install -y python3 python3-dev libffi6 libffi-dev libssl-dev curl build-essential procps && \
curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 && \
pip install -U cffi certbot && \
apt remove --purge -y python3-dev build-essential libffi-dev libssl-dev curl && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy in scripts for certbot
COPY ./scripts/ /scripts
RUN chmod +x /scripts/*.sh
# Add /scripts/startup directory to source more startup scripts
RUN mkdir -p /scripts/startup
# Copy in default nginx configuration (which just forwards ACME requests to
# certbot, or redirects to HTTPS, but has no HTTPS configurations by default).
RUN rm -f /etc/nginx/conf.d/*
COPY nginx_conf.d/ /etc/nginx/conf.d/
ENTRYPOINT []
CMD ["/bin/bash", "/scripts/entrypoint.sh"]