Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pmoranga
Forked from robeastham/cloud-config.yml
Created October 13, 2016 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pmoranga/6f4b1965898c3d413981e90d681ddeeb to your computer and use it in GitHub Desktop.
Save pmoranga/6f4b1965898c3d413981e90d681ddeeb to your computer and use it in GitHub Desktop.
This is a cloud-config file template for Rancher OS. Fill in the blanks and it'll automatically setup your Rancher Server behind an Nginx proxy and register Let's Encrypt SSL certs and then renew them automatically
#cloud-config
ssh_authorized_keys:
- ssh-rsa <my-public-key>
rancher:
services:
nginx-proxy:
image: jwilder/nginx-proxy:0.4.0
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- '/home/docker/nginx-proxy/ssl:/etc/nginx/certs:ro'
- '/etc/nginx/vhost.d'
- '/usr/share/nginx/html'
- '/var/run/docker.sock:/tmp/docker.sock:ro'
letsencrypt-nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion:v1.3
restart: unless-stopped
volumes_from:
- nginx-proxy
volumes:
- '/home/docker/nginx-proxy/ssl:/etc/nginx/certs:rw'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
rancher-server:
image: rancher/server:v1.2.0-pre3
restart: unless-stopped
environment:
- VIRTUAL_PORT=8080
- VIRTUAL_HOST=<my.domain.com>
- LETSENCRYPT_TEST=false
- LETSENCRYPT_HOST=<my.domain.com>
- LETSENCRYPT_EMAIL=<myemail@com>
- CATTLE_DB_CATTLE_MYSQL_HOST=<mysql-ip-or-hostname>
- CATTLE_DB_CATTLE_MYSQL_PORT=<mysql-port>
- CATTLE_DB_CATTLE_MYSQL_NAME=<mysql-schema-name>
- CATTLE_DB_CATTLE_USERNAME=<mysql-user>
- CATTLE_DB_CATTLE_PASSWORD=<my-sql-pass>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment