Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM nginxproxy/nginx-proxy:latest
  2. RUN apt-get update \
  3. && apt-get install -y -q --no-install-recommends \
  4. cron curl nginx-module-njs \
  5. && apt-get clean \
  6. && rm -r /var/lib/apt/lists/*
  7. ENV AUTO_UPGRADE=1
  8. ENV LE_WORKING_DIR=/acme.sh
  9. ENV LE_CONFIG_HOME=/acmecerts
  10. RUN curl https://get.acme.sh | sh && crontab -l | sed 's#> /dev/null##' | crontab - \
  11. && $LE_WORKING_DIR/acme.sh --set-default-ca --server letsencrypt
  12. VOLUME ["/acmecerts"]
  13. EXPOSE 443
  14. COPY nginx.tmpl /app/
  15. COPY Procfile /app/
  16. RUN echo "cron: cron -f" >>/app/Procfile
  17. COPY updatessl.sh /app/
  18. RUN chmod +x /app/updatessl.sh
  19. RUN mkdir -p /etc/nginx/stream.d && echo "stream { \
  20. include /etc/nginx/stream.d/*.conf; \
  21. }" >> /etc/nginx/nginx.conf
  22. RUN sed -i '1s|^|load_module modules/ngx_http_js_module.so;\n|' /etc/nginx/nginx.conf \
  23. && sed -i '1s|^|load_module modules/ngx_stream_js_module.so;\n|' /etc/nginx/nginx.conf
  24. RUN mkdir -p /etc/nginx/socks
  25. VOLUME ["/etc/nginx/stream.d"]
  26. COPY entry.sh /app/
  27. RUN chmod +x /app/entry.sh
  28. ENTRYPOINT ["/app/entry.sh"]
  29. CMD ["forego", "start", "-r"]