version: '3'

services:
  traefik:
    image: traefik:1.7
    command: -c /traefik.toml --logLevel=DEBUG
    ports:
      - "8085:80"
      - "8086:8080"
    networks:
      - traefik
    volumes:
      - ./traefik.toml:/traefik.toml
      - /var/run/docker.sock:/var/run/docker.sock

  whoami1:
    image: containous/whoami
    networks:
      - traefik
    labels:
      - "traefik.backend=whoami"
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:whoami.localhost.com"

  traefik-forward-auth:
    build: thomseddon/traefik-forward-auth:2
    command: ./traefik-forward-auth --rule.1.action=allow --rule.1.rule="Path(`/public`)"
    environment:
      - PROVIDERS_GOOGLE_CLIENT_ID=your-client-id
      - PROVIDERS_GOOGLE_CLIENT_SECRET=your-client-secret
      - SECRET=something-random
      - INSECURE_COOKIE=true
      - DOMAIN=yourcompany.com
      - LOG_LEVEL=debug
    networks:
      - traefik

networks:
  traefik: