FROM python:3.11-slim

# Install uv for fast package installation
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Set working directory
WORKDIR /app

# Copy project files
COPY pyproject.toml ./
COPY src/ ./src/

# Install dependencies using uv
RUN uv pip install --system --no-cache .

# Expose port
EXPOSE 8000

# Run the application
CMD ["uvicorn", "codegen_service.main:app", "--host", "0.0.0.0", "--port", "8000"]
