FROM python:3.12-bookworm

RUN apt-get update && apt-get install --no-install-recommends -y \
	build-essential \
	libpq-dev \
	&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
	&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements/* /tmp/requirements/
RUN pip install --no-cache-dir --requirement /tmp/requirements/local.txt

COPY manage.py manage.py
COPY config config
COPY apps apps

CMD ["celery", "-A", "config", "worker", "-l", "info"]
