Skip to content

Instantly share code, notes, and snippets.

@andif888
Created April 20, 2020 14:12
Show Gist options
  • Save andif888/624334bcdf6696034c06210cc9815245 to your computer and use it in GitHub Desktop.
Save andif888/624334bcdf6696034c06210cc9815245 to your computer and use it in GitHub Desktop.
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "8002:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
whoami:
image: "containous/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Path(`/blub`)"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.services.whoami.loadbalancer.server.port=80"
@andif888
Copy link
Author

A little different with same result:

version: "3.3"

services:

  traefik:
    image: "traefik:v2.2"
    container_name: "traefik"
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:2001"
    ports:
      - "8002:2001"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  whoami:
    image: "containous/whoami"
    container_name: "simple-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoamirouter.rule=Path(`/blub`)"
      - "traefik.http.routers.whoamirouter.entrypoints=web"
      - "traefik.http.routers.whoamirouter.service=whoamisvc"
      - "traefik.http.services.whoamisvc.loadbalancer.server.port=80"

@stdevel
Copy link

stdevel commented Apr 20, 2020

Brilliant, that's exactly what I needed! 🤩

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