version: '3.8'

services:
  talemate:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        - CUDA_AVAILABLE=${CUDA_AVAILABLE:-false}
    ports:
      - "${FRONTEND_PORT:-8080}:8080"
      - "${BACKEND_PORT:-5050}:5050"
    volumes:
      - ./config.yaml:/app/config.yaml
      - ./scenes:/app/scenes
      - ./templates:/app/templates
      - ./chroma:/app/chroma
    environment:
      - PYTHONUNBUFFERED=1
      - PYTHONPATH=/app/src:$PYTHONPATH
    command: ["/bin/bash", "-c", "source /app/talemate_env/bin/activate && python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050 --frontend-host 0.0.0.0 --frontend-port 8080"]