version: '3.4'

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

networks: 
  oc:
    external: true