FROM python:3.13-slim
RUN addgroup --system app && adduser --system --ingroup app app \
    && apt-get update && apt-get install -y --no-install-recommends git \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml README.md LICENSE ./
RUN mkdir repolens_worker
COPY repolens_worker/__init__.py ./repolens_worker/__init__.py
RUN pip install --no-cache-dir .
COPY repolens_worker ./repolens_worker
USER app
ENV PYTHONUNBUFFERED=1
CMD ["dramatiq", "repolens_worker.worker", "--processes", "1", "--threads", "4"]
