Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM centos:7.5.1804
  2. LABEL maintainer="tomishinets.v@sdsys.ru"
  3. COPY nginx.repo /etc/yum.repos.d/nginx.repo
  4. COPY generate.sh \
  5. renewal.sh \
  6. healthcheck.sh \
  7. /tmp/
  8. RUN yum install -y epel-release \
  9. && yum install -y yum-utils python2-certbot-nginx openssl ca-certificates mailx nginx \
  10. && yum install -y https://centos7.iuscommunity.org/ius-release.rpm \
  11. && yum install -y git2u \
  12. && yum clean all \
  13. && rm -rf /var/cache/yum \
  14. && mkdir -p /var/www/html/.well-known \
  15. && mkdir -p /var/log/letsencrypt \
  16. && touch /var/log/letsencrypt/letsencrypt.log \
  17. && chmod +x /tmp/generate.sh \
  18. && chmod +x /tmp/renewal.sh \
  19. && chmod +x /tmp/healthcheck.sh \
  20. && touch /tmp/renewal \
  21. # && ln -sf /dev/stdout /var/log/letsencrypt/letsencrypt.log \
  22. && ln -sf /dev/stdout /var/log/nginx/access.log \
  23. && ln -sf /dev/stderr /var/log/nginx/error.log
  24. COPY default.conf /etc/nginx/conf.d/
  25. ENTRYPOINT ["/tmp/docker-entrypoint.sh"]
  26. HEALTHCHECK --start-period=30s --interval=15s --timeout=5s --retries=2 CMD /tmp/healthcheck.sh
  27. EXPOSE 80
  28. CMD ["nginx", "-g", "daemon off;"]