FredBro

docker-compose.yml

Oct 1st, 2019
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.41 KB | None | 0 0
  1. version: '3'
  2.  
  3. services:
  4.   traefik:
  5.     image: traefik:v2.0
  6.     container_name: traefik
  7.     restart: unless-stopped
  8.     security_opt:
  9.      - no-new-privileges:true
  10.     networks:
  11.      - proxy
  12.     ports:
  13.      - 80:80
  14.       - 443:443
  15.     volumes:
  16.      - /etc/localtime:/etc/localtime:ro
  17.       - /var/run/docker.sock:/var/run/docker.sock:ro
  18.       - ./data/traefik.yml:/traefik.yml:ro
  19.       - ./data/acme.json:/acme.json
  20.     labels:
  21.      - "traefik.enable=true"
  22.       - "traefik.http.routers.traefik.entrypoints=http"
  23.       - "traefik.http.routers.traefik.rule=Host(`traefik.MyDomain.net`)"
  24.       - "traefik.http.middlewares.traefik-auth.basicauth.users=MyName:long number with some $ in it, I added $ in front of them to escape them "
  25.       - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
  26.       - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
  27.       - "traefik.http.routers.traefik-secure.entrypoints=https"
  28.       - "traefik.http.routers.traefik-secure.rule=Host(`traefik.MyDomain.net`)"
  29.       - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
  30.       - "traefik.http.routers.traefik-secure.tls=true"
  31.       - "traefik.http.routers.traefik-secure.tls.certresolver=http"
  32.       - "traefik.http.routers.traefik-secure.service=api@internal"
  33.       - "traefik.http.services.traefik.loadbalancer.server.port=8080"
  34.  
  35. networks:
  36.   proxy:
  37.     external: true
Advertisement
Add Comment
Please, Sign In to add comment