Skip to content

Instantly share code, notes, and snippets.

@albertzak
Created December 22, 2016 18:52
Show Gist options
  • Save albertzak/6b239b85ace7df1535c00626a431eda2 to your computer and use it in GitHub Desktop.
Save albertzak/6b239b85ace7df1535c00626a431eda2 to your computer and use it in GitHub Desktop.
Docker + nginx + Let's Encrypt = 😍
letsencrypt:
environment:
- [email protected]
image: 'jrcs/letsencrypt-nginx-proxy-companion:v1.3'
volumes:
- '/root/certs:/etc/nginx/certs'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
volumes_from:
- nginx
nginx:
image: 'jwilder/nginx-proxy:latest'
ports:
- '80:80'
- '443:443'
restart: always
volumes:
- '/root/certs:/etc/nginx/certs:ro'
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- '/var/run/docker.sock:/tmp/docker.sock:ro'
app1:
environment:
- [email protected]
- LETSENCRYPT_HOST=app1.example.com
- VIRTUAL_HOST=app1.example.com
- VIRTUAL_PORT=5000
expose:
- '5000'
app2:
environment:
- [email protected]
- LETSENCRYPT_HOST=app2.example.com
- VIRTUAL_HOST=app2.example.com
- VIRTUAL_PORT=3000
expose:
- '3000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment