Skip to content

Instantly share code, notes, and snippets.

@emcniece
Last active March 21, 2017 04:27
Show Gist options
  • Save emcniece/eb32a51e6e52017a94930c81e10f045d to your computer and use it in GitHub Desktop.
Save emcniece/eb32a51e6e52017a94930c81e10f045d to your computer and use it in GitHub Desktop.
Test Rgon-Proxy + Filesync
version: '2'
services:
nginx:
image: "nginx"
tty: true
stdin_open: true
ports:
- 80:80/tcp
- 443:443/tcp
volumes:
- /home/core/rp-filesync/storage/htpasswd:/etc/nginx/htpasswd:ro
- /home/core/rp-filesync/storage/conf:/etc/nginx/conf.d:ro
- /home/core/rp-filesync/storage/vhost:/etc/nginx/vhost.d:ro
- /home/core/rp-filesync/storage/certs:/etc/nginx/certs:ro
labels:
io.rancher.scheduler.global: 'true' # true for multi-host
rgon-proxy: nginx
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
rgon-proxy:
image: "causticlab/rgon-proxy:dev" # :latest for production
tty: true
stdin_open: true
links:
- nginx
ports:
- 402:402/tcp
volumes:
- /home/core/rp-filesync/storage/rancher-gen:/etc/rancher-gen
- /home/core/rp-filesync/storage/htpasswd:/etc/nginx/htpasswd:rw
- /home/core/rp-filesync/storage/conf:/etc/nginx/conf.d:rw
- /home/core/rp-filesync/storage/vhost:/etc/nginx/vhost.d:rw
- /home/core/rp-filesync/storage/certs:/etc/nginx/certs:rw
links:
- nginx
labels:
io.rancher.scheduler.global: 'false'
io.rancher.container.create_agent: 'true'
io.rancher.container.agent.role: 'environment'
io.rancher.scheduler.affinity:host_label: rgon.primary=true
rgon-proxy: rancher-gen
rgon-acme: 'true'
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
environment:
RGEN_CONFIG_ONETIME: '/etc/rancher-gen/default/rancher-gen-onetime.cfg'
ACME_EMAIL: emcniece+rptest1@gmail.com
ACME_API: https://acme-staging.api.letsencrypt.org/directory
ACME_AGREE_TOS: true
fs-server:
image: "causticlab/filesync"
tty: true
stdin_open: true
labels:
io.rancher.scheduler.affinity:host_label: rgon.primary=true
volumes:
- /home/core/rp-filesync/storage:/share
environment:
FILESYNC_MODE: 'server'
fs-client:
image: "causticlab/filesync"
tty: true
stdin_open: true
volumes:
- /home/core/rp-filesync/storage:/share
links:
- fs-server
labels:
io.rancher.scheduler.global: 'true'
io.rancher.scheduler.affinity:host_label_ne: rgon.primary=true
environment:
FILESYNC_MODE: 'client'
FILESYNC_IP: 'fs-server'
@emcniece
Copy link
Author

Updated: removed sidekicks, now all volumes must be specified on all containers. Relies on the local filesystem of each host, and the Filesync server/clients transfer config and certificates between hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment