Skip to content

Instantly share code, notes, and snippets.

@yuetyeelo2855
Created December 17, 2016 02:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuetyeelo2855/5d8ab4803fafac93b009081a19f3bcd3 to your computer and use it in GitHub Desktop.
Save yuetyeelo2855/5d8ab4803fafac93b009081a19f3bcd3 to your computer and use it in GitHub Desktop.
Example docker-compose.yml of Nginx Proxy with Let's Encrypt
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
privileged: true
ports:
- 80:80
- 443:443
volumes:
- ./nginx-proxy/certs:/etc/nginx/certs:ro
- ./nginx-proxy/htpasswd:/etc/nginx/htpasswd
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: always
letsencrypt-nginx:
image: alastaircoote/docker-letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx
privileged: true
volumes:
- ./nginx-proxy/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes_from:
- nginx-proxy
restart: always
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=[HOST]
- LETSENCRYPT_HOST=[HOST]
- LETSENCRYPT_EMAIL=[EMAIL]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment