docker-compose.yml 1.0 KB

1234567891011121314151617181920212223242526
  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. 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;\"'"
  13. nginx-relay:
  14. build: ./nginx-relay/
  15. restart: unless-stopped
  16. volumes:
  17. - ./data/nginx-relay:/etc/nginx/conf.d
  18. 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;\"'"
  19. certbot:
  20. image: certbot/certbot
  21. restart: unless-stopped
  22. volumes:
  23. - ./data/certbot/conf:/etc/letsencrypt
  24. - ./data/certbot/www:/var/www/certbot
  25. entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"