Skip to content

Instantly share code, notes, and snippets.

@jodykpw
Created July 10, 2020 00:30
Show Gist options
  • Save jodykpw/b8500795daba4bdf643baf59d584e349 to your computer and use it in GitHub Desktop.
Save jodykpw/b8500795daba4bdf643baf59d584e349 to your computer and use it in GitHub Desktop.
Install Rancher on a Single Node Using Docker with Traefik
version: '3'
services:
rancher:
container_name: rancher
restart: always
image: rancher/rancher:v2.4.4
networks:
- traefik
labels:
# Dynamic configuration with Docker Labels
# Ref: https://docs.traefik.io/reference/dynamic-configuration/docker/
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.middlewares.rancher-behind-proxy.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.rancher.entrypoints=web"
- "traefik.http.routers.rancher.rule=Host(`rancher.domain.com`)"
- "traefik.http.routers.rancher.service=rancher"
- "traefik.http.routers.rancher.middlewares=rancher-behind-proxy"
- "traefik.http.services.rancher.loadbalancer.server.port=80"
volumes:
- rancher:/var/lib/rancher
- auditlog:/var/log/auditlog
volumes:
rancher:
driver: local
auditlog:
driver: local
networks:
traefik:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment