version: '3.4'

services:
  oc-scheduler:
    environment: 
      - MONGO_DATABASE=DC_myDC
    image: 'oc-scheduler:latest'
    labels:
        - "traefik.enable=true"
        - "traefik.http.routers.scheduler.entrypoints=web"
        - "traefik.http.routers.scheduler.rule=PathPrefix(`/scheduler`)"
        - "traefik.http.middlewares.scheduler-rewrite.replacepathregex.regex=^/scheduler(.*)"
        - "traefik.http.middlewares.scheduler-rewrite.replacepathregex.replacement=/oc$$1"
        - "traefik.http.routers.scheduler.middlewares=scheduler-rewrite"
        - "traefik.http.services.scheduler.loadbalancer.server.port=8080"
        - "traefik.http.middlewares.scheduler.forwardauth.address=http://oc-auth:8080/oc/forward"
    ports:
      - 8090:8080
    container_name: oc-scheduler
    networks: 
      - oc

networks: 
  oc:
    external: true