volumes:
  scout-blaze-data:

services:
  traefik:
    labels:
      - "traefik.http.middlewares.additional-users-auth.basicauth.users=${SCOUT_BASIC_AUTH_USERS}"

  scout-blaze:
    image: docker.verbis.dkfz.de/cache/samply/blaze:${BLAZE_TAG}
    container_name: bridgehead-scout-blaze
    environment:
      BASE_URL: "http://bridgehead-scout-blaze:8080"
      ENFORCE_REFERENTIAL_INTEGRITY: "false"
    volumes:
      - "scout-blaze-data:/app/data"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.scout-blaze.rule=PathPrefix(`/scout-blaze`)"
      - "traefik.http.middlewares.scout-blaze-stripprefix.stripprefix.prefixes=/scout-blaze"
      - "traefik.http.services.scout-blaze.loadbalancer.server.port=8080"
      - "traefik.http.routers.scout-blaze.middlewares=scout-blaze-stripprefix,additional-users-auth"
      - "traefik.http.routers.scout-blaze.tls=true"

  scout:
    image: samply/scout:main
    container_name: bridgehead-scout
    configs:
      - scout.toml
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.scout.rule=PathPrefix(`/scout`)"
      - "traefik.http.services.scout.loadbalancer.server.port=8080"
      - "traefik.http.routers.scout.middlewares=additional-users-auth"
      - "traefik.http.routers.scout.tls=true"

configs:
  scout.toml:
    content: |
      fhir_base_url = "http://scout-blaze:8080/fhir"
