docker-compose.yml 1.0 KB

123456789101112131415161718192021222324252627
  1. version: '3'
  2. services:
  3. nginx-terminate:
  4. build: ./nginx-terminate/
  5. restart: unless-stopped
  6. volumes:
  7. - ./data/nginx-terminate:/etc/nginx/conf.d
  8. - ./data/certbot/conf:/etc/letsencrypt
  9. - ./data/certbot/www:/var/www/certbot
  10. ports:
  11. - "443:443"
  12. - "80:80"
  13. command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; /opt/nginx/sbin/nginx -s reload; done & /opt/nginx/sbin/nginx -c /etc/nginx/conf.d/nginx.conf -g \"daemon off;\"'"
  14. nginx-relay:
  15. build: ./nginx-relay/
  16. restart: unless-stopped
  17. volumes:
  18. - ./data/nginx-relay:/etc/nginx/conf.d
  19. command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; /opt/nginx/sbin/nginx -s reload; done & /opt/nginx/sbin/nginx -c /etc/nginx/conf.d/nginx.conf -g \"daemon off;\"'"
  20. certbot:
  21. image: certbot/certbot
  22. restart: unless-stopped
  23. volumes:
  24. - ./data/certbot/conf:/etc/letsencrypt
  25. - ./data/certbot/www:/var/www/certbot
  26. entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"