version: '3.4'

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


networks: 
  oc:
    external: true