Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Forked from pmoranga/cloud-config.yml
Created April 7, 2019 19:49
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 ruanbekker/4c6ae1dc2a006262204ad7cf521a9baa to your computer and use it in GitHub Desktop.
Save ruanbekker/4c6ae1dc2a006262204ad7cf521a9baa 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