services:
  # Bindestrek, IKKE understrek: MinIO validerer Host-headeren strengt og
  # avviser understrek som ugyldig vertsnavn (funnet under scratch-
  # verifisering -- se CLAUDE.md-status).
  teecup-minio:
    image: minio/minio:latest
    container_name: teecup-minio
    environment:
      MINIO_ROOT_USER: ${TEECUP_MINIO_ROOT_USER}
      MINIO_ROOT_PASSWORD: ${TEECUP_MINIO_ROOT_PASSWORD}
    command: server /data --console-address ":9001"
    volumes:
      - teecup_minio_data:/data
    networks:
      - teeoff_default
    restart: unless-stopped

  teecup_api:
    build: .
    container_name: teecup_api
    environment:
      TEECUP_DB_HOST: ${TEECUP_DB_HOST}
      TEECUP_DB_PORT: ${TEECUP_DB_PORT}
      TEECUP_DB_NAME: ${TEECUP_DB_NAME}
      TEECUP_DB_USER: ${TEECUP_DB_USER}
      TEECUP_DB_PASS: ${TEECUP_DB_PASS}
      TEECUP_SESSION_SECRET: ${TEECUP_SESSION_SECRET}
      TEECUP_SMTP_SERVER: ${TEECUP_SMTP_SERVER}
      TEECUP_SMTP_PORT: ${TEECUP_SMTP_PORT}
      TEECUP_SMTP_USER: ${TEECUP_SMTP_USER}
      TEECUP_SMTP_PASS: ${TEECUP_SMTP_PASS}
      TEECUP_FROM_EMAIL: ${TEECUP_FROM_EMAIL}
      TEECUP_MINIO_ROOT_USER: ${TEECUP_MINIO_ROOT_USER}
      TEECUP_MINIO_ROOT_PASSWORD: ${TEECUP_MINIO_ROOT_PASSWORD}
      TEECUP_MINIO_BUCKET: ${TEECUP_MINIO_BUCKET}
      TEECUP_VAPID_PRIVATE_KEY: ${TEECUP_VAPID_PRIVATE_KEY}
      TEECUP_VAPID_PUBLIC_KEY: ${TEECUP_VAPID_PUBLIC_KEY}
    networks:
      - teeoff_default
    restart: unless-stopped
    depends_on:
      - teecup-minio

  teecup_frontend:
    build:
      context: ./frontend
      args:
        TEECUP_API_ORIGIN: http://teecup_api:8000
    container_name: teecup_frontend
    networks:
      - teeoff_default
    restart: unless-stopped
    depends_on:
      - teecup_api

volumes:
  teecup_minio_data:

networks:
  teeoff_default:
    external: true
