Skip to content

Instantly share code, notes, and snippets.

@mykiwi
Created January 22, 2017 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykiwi/65d070b4ea63252c411d550a5233afdd to your computer and use it in GitHub Desktop.
Save mykiwi/65d070b4ea63252c411d550a5233afdd to your computer and use it in GitHub Desktop.
Rancher + Let's Encrypt
# frontend
# domains, load balancer, https (with let's encrypt) and redirect to https
https-redirect:
image: geldim/https-redirect
letsencrypt-nginx:
tty: true
image: nginx:alpine
stdin_open: true
volumes:
- letsencrypt-verify:/usr/share/nginx/html/
labels:
io.rancher.sidekicks: rancher-lets-encrypt
rancher-lets-encrypt:
tty: true
image: tozny/rancher-lets-encrypt
stdin_open: true
environment:
- DOMAINS=subdomain1.example.com,subdomain2.example.com,subdomain3.example.com
- CERTBOT_WEBROOT=/var/www
- CERTBOT_EMAIL=someemail@example.com
- RENEW_BEFORE_DAYS=14
- LOOP_TIME=300
- STAGING=False
- HOST_CHECK_PORT=80
- HOST_CHECK_LOOP_TIME=10
volumes:
- letsencrypt-verify:/var/www/
- letsencrypt-certs:/etc/letsencrypt/
labels:
io.rancher.container.create_agent: 'true'
io.rancher.container.agent.role: environment
# add a
# load-balancer
#
# > 80 > /.well-known > letsencrypt-nginx
# > 80 > > https-redirect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment