services: api: build: context: ./api dockerfile: docker/Dockerfile volumes: - ./api:/app # Optional: echte status.txt aus der Produktion zum Testen einbinden, z.B. # - ./status.txt:/status.txt:ro working_dir: /app # Achtung: Eine Aenderung des Host-Ports muss in .env (MONITOR_API_BASE) nachgezogen # werden - das Frontend laeuft im Browser und erreicht die API nicht ueber das # Compose-Netzwerk, sondern ueber genau diesen Port. ports: - "8091:8080" environment: MONITOR_DB_PATH: /app/data/monitor.sqlite MONITOR_ADMIN_API_KEY: ${MONITOR_ADMIN_API_KEY:-dev-admin-key} MONITOR_STATUS_FILE: /status.txt MONITOR_DESK_COUNT: 8 MONITOR_SSE_MAX_ITERATIONS: 30 MONITOR_SSE_POLL_INTERVAL: 2 CODEBERG_API_BASE: https://codeberg.org/api/v1 CODEBERG_OWNER: ${CODEBERG_OWNER:-fds2610} CODEBERG_REPO: ${CODEBERG_REPO:-monitor} CODEBERG_TOKEN: ${CODEBERG_TOKEN:-} # Statisches Frontend (html/) - Phase 2 der Neuausrichtung (Buero-Visualisierung). # Nur zur lokalen Ansicht/Entwicklung, kein Build-Schritt noetig (Vanilla HTML/CSS/JS). web: image: nginx:alpine volumes: - ./html:/usr/share/nginx/html:ro # Ueberlagert den Platzhalter html/API.md - der muss existieren, weil in # einem read-only gemounteten Verzeichnis kein Mountpoint angelegt werden kann. - ./API.md:/usr/share/nginx/html/API.md:ro # Setzt office.html als Einstiegsseite (sonst 403 auf der Basis-URL) und liefert # /config.js aus. Als Template gemountet, damit das nginx-Image beim Start # MONITOR_API_BASE per envsubst einsetzt (Ausgabe: /etc/nginx/conf.d/default.conf). - ./docker/nginx/default.conf.template:/etc/nginx/templates/default.conf.template:ro environment: # Wird in docker/nginx/default.conf.template eingesetzt und als /config.js an den # Browser ausgeliefert. Leer = gleicher Origin (relatives /api/v1). MONITOR_API_BASE: ${MONITOR_API_BASE:-} ports: - "8090:80" # Fuehrt die Node-basierten Frontend-Tests (tests/frontend/) aus. Node/npm sind nur im # Container noetig, nicht auf dem Host (analog zum api-Service mit PHP/Composer). frontend: image: node:20-alpine working_dir: /app volumes: - .:/app command: npm test