version: "3.8"

services:
  gwoe-antragspruefer:
    build: .
    container_name: gwoe-antragspruefer
    restart: unless-stopped
    environment:
      - DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY}
      - KEYCLOAK_URL=https://sso.toppyr.de
      - KEYCLOAK_REALM=collaboration
      - KEYCLOAK_CLIENT_ID=gwoe-antragspruefer
    volumes:
      - ./data:/app/data
      - ./reports:/app/reports
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.gwoe.rule=Host(`gwoe.toppyr.de`)"
      - "traefik.http.routers.gwoe.entrypoints=websecure"
      - "traefik.http.routers.gwoe.tls=true"
      - "traefik.http.routers.gwoe.tls.certresolver=letsencrypt"
      - "traefik.http.services.gwoe.loadbalancer.server.port=8000"
    networks:
      - collaboration_collaboration

  # Doku-Hosting (#62 Phase 2): mkdocs-Output als statische Site.
  # URL: https://docs.toppyr.de/gwoe-antragspruefer/
  # Update: mkdocs build && scp -r site/* vserver:/opt/gwoe-antragspruefer/docs-site/
  gwoe-docs:
    image: nginx:alpine
    container_name: gwoe-docs
    restart: unless-stopped
    volumes:
      - ./docs-site:/usr/share/nginx/html/gwoe-antragspruefer:ro
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.gwoe-docs.rule=Host(`docs.toppyr.de`)"
      - "traefik.http.routers.gwoe-docs.entrypoints=websecure"
      - "traefik.http.routers.gwoe-docs.tls=true"
      - "traefik.http.routers.gwoe-docs.tls.certresolver=letsencrypt"
      - "traefik.http.services.gwoe-docs.loadbalancer.server.port=80"
    networks:
      - collaboration_collaboration

networks:
  collaboration_collaboration:
    external: true
