FROM python:3.11-slim

WORKDIR /srv/app

RUN apt update && \
  apt install --no-install-recommends -y libpq-dev build-essential curl gcc sassc libpango-1.0-0 libpangoft2-1.0-0 libjpeg-dev libopenjp2-7-dev libffi-dev libpangoft2-1.0-0 libcairo2 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info gettext &&\
  rm -rf /var/lib/apt/lists/*

COPY --chown=www-data:www-data . .

run python -m pip install --upgrade pip \
  && python -m pip install uwsgi \
  && python -m pip install -r requirements.txt \
  && python -m pip install .

ENTRYPOINT [ "uwsgi", "-i", "uwsgi.ini" ]
