version: "3.7"

services:
  dis:
    build: .
    restart: always
    environment:
      CONFIG_PATH: ${CONFIG_PATH}
    labels:

      - "traefik.enable=True"
      - "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
      - "traefik.http.routers.core_panel.rule=${HOST_RULE}"

      - "traefik.http.routers.core_fallback.rule=HostRegexp(`{catchall:.*}`)"
      - "traefik.http.routers.core_fallback.priority=1"

      - "traefik.http.routers.core_panel.tls=${HTTPS_ENABLED}"
      - "traefik.http.routers.core_panel.tls.certresolver=distillery"
      - "traefik.http.services.core_panel.loadbalancer.server.port=8888"


    volumes:
      # TODO: Mount docker socket properly!
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "${CONFIG_PATH}:${CONFIG_PATH}:ro"
      - "${DEPLOY_ROOT}:${DEPLOY_ROOT}:rw"
      - "${SELF_OVERRIDES_FILE}:${SELF_OVERRIDES_FILE}:ro"
      - "${SELF_RESOLVER_BLOCK_FILE}:${SELF_RESOLVER_BLOCK_FILE}:ro"
      - "${CUSTOM_ASSETS_PATH}:${CUSTOM_ASSETS_PATH}:ro"

networks:
  default:
    name: ${DOCKER_NETWORK_NAME}
    external: true
