pilasguru

Ttraefik with simple docker-compose.yaml

Jun 12th, 2020 (edited)
4,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.87 KB | None | 0 0
  1. # http://localhost:8888 -> traefik dashboard
  2. # http://localhost:9999 -> application
  3.  
  4. version: '3'
  5.  
  6. services:
  7.     traefik:
  8.         image: traefik:v2.0
  9.         command:
  10.            - "--api.insecure=true"
  11.             - "--providers.docker=true"
  12.             - "--entryPoints.web.address=:9999"
  13.         ports:
  14.            - 8888:8080
  15.             - 9999:9999
  16.         volumes:
  17.            - /var/run/docker.sock:/var/run/docker.sock
  18.  
  19. # docker run --rm -it -p 9999:3000 adongy/hostname-docker
  20.     hostname:
  21.         image: adongy/hostname-docker
  22.         labels:
  23.          - "traefik.enable=true"
  24.           - traefik.http.routers.hostname.rule=Host(`localhost`)
  25.           - traefik.http.middlewares.hostname.compress=true
  26.           - traefik.http.routers.hostname.middlewares=hostname@docker
  27.           - traefik.port=3000
  28.  
  29. # docker-compose up -d --no-deps --scale hostname=5
Add Comment
Please, Sign In to add comment