Skip to content

Instantly share code, notes, and snippets.

@mohsenasm
Created February 26, 2018 14:42
Show Gist options
  • Save mohsenasm/5995a7039deff6f17c0f0651a5c59c9f to your computer and use it in GitHub Desktop.
Save mohsenasm/5995a7039deff6f17c0f0651a5c59c9f to your computer and use it in GitHub Desktop.
docker-letsencrypt-nginx-proxy-companion for docker-compose version 3
version: "3"
services:
nginx-proxy:
image: jwilder/nginx-proxy
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- certs:/etc/nginx/certs:ro
- vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
depends_on:
- nginx-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- certs:/etc/nginx/certs:rw
- vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
whoami:
image: jwilder/whoami
environment:
VIRTUAL_HOST: example.com
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: support@example.com
volumes:
certs:
vhost:
nginx-html:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment