Skip to content

Instantly share code, notes, and snippets.

@MinimaJack
Created January 6, 2021 20:56
Show Gist options
  • Save MinimaJack/e7ba597c3431a3e8074847c0df70b5ab to your computer and use it in GitHub Desktop.
Save MinimaJack/e7ba597c3431a3e8074847c0df70b5ab to your computer and use it in GitHub Desktop.
docker-compose.yml
version: "2"
services:
nginx:
image: nginx:latest
restart: always
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- ./nginx/:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
restart: always
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment