Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. FROM nginxproxymanager/testca AS testca
  2. FROM ghcr.io/letsencrypt/pebble AS pebbleca
  3. FROM nginxproxymanager/nginx-full:acmesh-golang
  4. LABEL maintainer="Jamie Curnow <[email protected]>"
  5. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  6. ARG GOPROXY
  7. ARG GOPRIVATE
  8. ENV ACMESH_CONFIG_HOME=/data/.acme.sh/config \
  9. ACMESH_HOME=/data/.acme.sh \
  10. CERT_HOME=/data/.acme.sh/certs \
  11. CGO_ENABLED=0 \
  12. GOPROXY=$GOPROXY \
  13. GOPRIVATE=$GOPRIVATE \
  14. LE_CONFIG_HOME=/data/.acme.sh/config \
  15. LE_WORKING_DIR=/data/.acme.sh \
  16. S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
  17. S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
  18. S6_FIX_ATTRS_HIDDEN=1 \
  19. S6_KILL_FINISH_MAXTIME=10000 \
  20. S6_VERBOSITY=2
  21. RUN echo "fs.file-max = 65535" > /etc/sysctl.conf
  22. # node, fail2ban
  23. RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
  24. && apt-get update \
  25. && apt-get install -y --no-install-recommends nodejs vim dnsutils fail2ban logrotate \
  26. && npm install --location=global yarn \
  27. && apt-get clean \
  28. && rm -rf /var/lib/apt/lists/* /etc/fail2ban
  29. # Task
  30. RUN cd /usr \
  31. && curl -sL https://taskfile.dev/install.sh | sh \
  32. && cd /root
  33. COPY docker/rootfs /
  34. RUN rm -f /etc/nginx/conf.d/production.conf
  35. # s6 overlay
  36. COPY scripts/install-s6 /tmp/install-s6
  37. RUN /tmp/install-s6 && rm -rf /tmp/*
  38. # Fix for golang dev:
  39. RUN chown -R 1000:1000 /opt/go
  40. COPY --from=pebbleca /test/certs/pebble.minica.pem /etc/ssl/certs/pebble.minica.pem
  41. COPY --from=testca /home/step/certs/root_ca.crt /etc/ssl/certs/NginxProxyManager.crt
  42. EXPOSE 80
  43. CMD [ "/init" ]
  44. HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://127.0.0.1:81/api || exit 1