services:
  backend:
    build: ./backend
    expose:
      - "80"
    environment:
      - DATABASE_URL=sqlite+aiosqlite:///./data/h2h.db
      - JWT_SECRET=${JWT_SECRET:-your-secret-key-change-in-production-min-32-characters}
      - JWT_ALGORITHM=HS256
      - ACCESS_TOKEN_EXPIRE_MINUTES=30
      - REFRESH_TOKEN_EXPIRE_DAYS=7
    volumes:
      - sqlite_data:/app/data
    command: uvicorn app.main:app --host 0.0.0.0 --port 80 --reload

  frontend:
    build: ./frontend
    expose:
      - "80"
    environment:
      - VITE_API_URL=https://h2h-backend.host.letsgetnashty.com
      - VITE_WS_URL=wss://h2h-backend.host.letsgetnashty.com
    command: npm run dev -- --host --port 80
    depends_on:
      - backend

volumes:
  sqlite_data:
