nginx_docker-swag/Dockerfile
2021-02-18 18:01:53 -05:00

89 lines
2.0 KiB
Docker

# ARG TARGETPLATFORM
# FROM --platform=${TARGETPLATFORM:-linux/amd64} ubuntu:focal
FROM ubuntu:focal
ARG TARGETPLATFORM
ARG TARGETARCH
ARG BUILD_DATE
LABEL build_version="${TARGETPLATFORM} - ${BUILD_DATE}"
# ENV TLD
# ENV SUBDOMAINS
ENV ONLY_SUBDOMAINS=false
ENV PROPAGATION=60
ENV STAGING=false
# install supporting packages
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
cron \
curl \
gcc \
libssl-dev \
libffi-dev \
openssl \
python3 \
python3-pip \
tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
# s6 overlay
COPY ./scripts/install-s6.sh /tmp/install-s6.sh
RUN chmod +x /tmp/install-s6.sh \
&& /tmp/install-s6.sh ${TARGETPLATFORM} \
&& rm -rf /tmp/*
# ENV S6_ARCH=$(echo ${TARGETPLATFORM} | sed "s|linux\/||g")
# ADD https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-${S6_ARCH}-installer /tmp
# RUN /tmp/s6-overlay-${S6_ARCH}-installer / \
# && rm -rf /tmp
EXPOSE 80 443
# install certbot
RUN pip3 install \
pip \
&& pip3 install \
certbot \
certbot-dns-cloudflare \
cryptography \
requests \
&& for cleanfiles in *.pyc *.pyo; \
do \
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
; done \
&& rm -rf \
/tmp/* \
/root/.cache
# RUN mkdir -p \
# /etc/letsencrypt/accounts \
# /etc/letsencrypt/live \
# /etc/letsencrypt/renewal \
# /etc/letsencrypt/renewal-hooks/deploy \
# /etc/letsencrypt/renewal-hooks/post \
# /etc/letsencrypt/renewal-hooks/pre
RUN mkdir -p \
/app \
/config \
/defaults \
/letsencrypt
VOLUME /config
VOLUME /letsencrypt
# # create initial user
# RUN groupmod -g 1000 users && \
# useradd -u 911 -U -d /config -s /bin/false abc && \
# usermod -G users abc
COPY root/ /
# RUN chmod -R +x /app
ENTRYPOINT [ "/init" ]