FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential libpq-dev postgresql-client \
    libpango-1.0-0 libpangoft2-1.0-0 libcairo2 libffi-dev \
    libgdk-pixbuf-xlib-2.0-0 libharfbuzz0b libfribidi0 \
    libjpeg-dev libpng-dev \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
