Skip to content

Instantly share code, notes, and snippets.

@waj
Last active March 14, 2019 20:49
Show Gist options
  • Save waj/d6fa070876029b51665841e3ac6fcab7 to your computer and use it in GitHub Desktop.
Save waj/d6fa070876029b51665841e3ac6fcab7 to your computer and use it in GitHub Desktop.
Launch Rancher server with Docker Compose
version: '2'
volumes:
cattle:
mysql-log:
nginx-certs:
nginx-dhparam:
nginx-vhost:
nginx-html:
services:
server:
image: rancher/server:stable
restart: unless-stopped
volumes:
- /mnt/rancher-mysql:/var/lib/mysql
- cattle:/var/lib/cattle
- mysql-log:/var/log/mysql
environment:
VIRTUAL_HOST: <hostname>
VIRTUAL_PORT: 8080
LETSENCRYPT_HOST: <hostname>
LETSENCRYPT_EMAIL: <email>
proxy:
image: jwilder/nginx-proxy
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- nginx-certs:/etc/nginx/certs:ro
- nginx-dhparam:/etc/nginx/dhparam
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nginx-certs:/etc/nginx/certs:rw
- nginx-dhparam:/etc/nginx/dhparam
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
backup:
image: deitch/mysql-backup
restart: unless-stopped
environment:
DB_SERVER: server
DB_USER: cattle
DB_PASS: cattle
DB_DUMP_TARGET: s3://<bucket>
AWS_ACCESS_KEY_ID: <aws_access_key_id>
AWS_SECRET_ACCESS_KEY: <aws_secret_access_key>
AWS_DEFAULT_REGION: us-east-1
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::<bucket>/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment