FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim

# Install git for semantic-release and editable installs
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1

# Copy the project files
COPY pyproject.toml uv.lock README.md LICENSE ./
COPY src/ ./src/
COPY examples/temporal/ ./examples/temporal/

# Install the project and temporal dependencies
RUN uv sync --group temporal

# Set the path to include the virtualenv's bin
ENV PATH="/app/.venv/bin:$PATH"

# Default to running the worker, but this can be overridden
CMD ["python", "examples/temporal/worker.py"]
