Commit 2d67a926 authored by Stefan Scherer's avatar Stefan Scherer

Traefik + Portainer in swarm mode

parent 2ac09a7d
# Traefik + Portainer in Swarm mode
You need Docker Engine EE 19.03 or the latest master build from
as this version supports the npipe volumes in stack yml files.
```
curl.exe -o docker.zip https://master.dockerproject.com/windows/x86_64/docker.zip
```
version: "3.3"
services:
appetizer:
image: chocolateyfest/appetizer:1.2.0
deploy:
labels:
- "traefik.backend.loadbalancer.sticky=true"
- "traefik.backend.loadbalancer.swarm=true"
- "traefik.backend=appetizer"
- "traefik.entrypoints=https"
- "traefik.frontend.passHostHeader=true"
- "traefik.frontend.rule=Host:appetizer.YOUR.DOMAIN"
- "traefik.port=8080"
restart_policy:
condition: on-failure
version: "3.3"
services:
portainer:
image: stefanscherer/portainer:1.20.1-1809
volumes:
- portainer_data:C:/data
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
deploy:
labels:
- "traefik.backend.loadbalancer.sticky=true"
- "traefik.backend.loadbalancer.swarm=true"
- "traefik.backend=portainer"
- "traefik.entrypoints=https"
- "traefik.frontend.passHostHeader=true"
- "traefik.frontend.rule=Host:portainer.YOUR.DOMAIN"
- "traefik.port=9000"
placement:
constraints: [node.role==manager]
restart_policy:
condition: on-failure
volumes:
portainer_data: {}
version: "3.3"
services:
traefik:
image: stefanscherer/traefik-windows:v1.7.9
command:
- "--api"
- "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entrypoints=Name:https Address::443 TLS"
- "--defaultentrypoints=http,https"
- "--docker.endpoint=npipe:////./pipe/docker_engine"
- "--acme"
- "--acme.storage=C:/acme/certs.json"
- "--acme.entryPoint=https"
- "--acme.httpChallenge.entryPoint=http"
- "--acme.onHostRule=true"
- "--acme.onDemand=false"
- "--acme.email=YOUR@EMAIL.ADDRESS"
# - "--acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--docker"
- "--docker.swarmMode"
- "--docker.domain=YOUR.DOMAIN"
- "--docker.watch"
- "--logLevel=DEBUG"
ports:
- "80:80" #The HTTP port
- "8080:8080" #The Web UI (enabled by --api)
- "443:443"
volumes:
- traefik_prod_certs:C:/acme
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
deploy:
placement:
constraints: [node.role==manager]
restart_policy:
condition: on-failure
volumes:
traefik_prod_certs: {}
version: "3.3"
services:
whoami:
image: stefanscherer/whoami:latest
deploy:
labels:
- "traefik.backend.loadbalancer.sticky=true"
- "traefik.backend.loadbalancer.swarm=true"
- "traefik.backend=whoami"
- "traefik.entrypoints=https"
- "traefik.frontend.passHostHeader=true"
- "traefik.frontend.rule=Host:YOUR.DOMAIN"
- "traefik.port=8080"
restart_policy:
condition: on-failure
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment