services:
  hermes:
    build:
      context: ./backend/hermes
      dockerfile: dockerfile

    container_name: hermes-api
    restart: unless-stopped

    environment:
      DATABASE_URL: ${DATABASE_URL}
      APP_NAME: Hermes API
      APP_VERSION: 0.1.0
      SECRET_KEY: ${SECRET_KEY}
      ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-60}
      JWT_ISSUER: ${JWT_ISSUER:-hermes}
      LOG_LEVEL: ${LOG_LEVEL:-INFO}
      INITIAL_ADMIN_USERNAME: ${INITIAL_ADMIN_USERNAME:-}
      INITIAL_ADMIN_EMAIL: ${INITIAL_ADMIN_EMAIL:-}
      INITIAL_ADMIN_PASSWORD: ${INITIAL_ADMIN_PASSWORD:-}
      INITIAL_ADMIN_FIRST_NAME: ${INITIAL_ADMIN_FIRST_NAME:-}
      INITIAL_ADMIN_LAST_NAME: ${INITIAL_ADMIN_LAST_NAME:-}
      STORAGE_PROVIDER: ${STORAGE_PROVIDER:-local}
      STORAGE_BASE_PATH: ${STORAGE_BASE_PATH:-/data/storage}
      STORAGE_MAX_UPLOAD_MB: ${STORAGE_MAX_UPLOAD_MB:-50}
      KNOWLEDGE_STORAGE_PATH: ${KNOWLEDGE_STORAGE_PATH:-/data/knowledge}
      KNOWLEDGE_MAX_UPLOAD_MB: ${KNOWLEDGE_MAX_UPLOAD_MB:-50}
      OLYMPUS_REPAIR_INTAKE_TOKEN: ${OLYMPUS_REPAIR_INTAKE_TOKEN:-}
      PUBLIC_REPAIR_STATUS_BASE_URL: ${PUBLIC_REPAIR_STATUS_BASE_URL:-}
      SMTP_HOST: ${SMTP_HOST:-}
      SMTP_PORT: ${SMTP_PORT:-587}
      SMTP_USERNAME: ${SMTP_USERNAME:-}
      SMTP_PASSWORD: ${SMTP_PASSWORD:-}
      SMTP_FROM_EMAIL: ${SMTP_FROM_EMAIL:-}
      SMTP_FROM_NAME: ${SMTP_FROM_NAME:-Funktechnik Schubert}
      SMTP_USE_TLS: ${SMTP_USE_TLS:-true}

    volumes:
      - ${STORAGE_HOST_PATH:-./storage}:/data/storage

    expose:
      - "8000"

    networks:
      - olympus-network

  athena:
    build:
      context: ./frontend/athena
      dockerfile: Dockerfile

    container_name: athena-web
    restart: unless-stopped

    environment:
      NODE_ENV: production
      HERMES_INTERNAL_URL: http://hermes:8000
      AUTH_COOKIE_SECURE: ${AUTH_COOKIE_SECURE:-false}
      ATHENA_PUBLIC_ORIGIN: ${ATHENA_PUBLIC_ORIGIN:-http://localhost:3001}

    ports:
      - "3001:3000"

    depends_on:
      - hermes

    networks:
      - olympus-network

networks:
  olympus-network:
    external: true
