FROM python:3.12-slim # GDAL and geo dependencies for GeoDjango RUN apt-get update && apt-get install -y --no-install-recommends \ gdal-bin \ libgdal-dev \ libgeos-dev \ libproj-dev \ binutils \ && rm -rf /var/lib/apt/lists/* ENV GDAL_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libgdal.so ENV GEOS_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libgeos_c.so WORKDIR /app ARG REQUIREMENTS=base COPY requirements/ requirements/ RUN pip install --no-cache-dir -r requirements/${REQUIREMENTS}.txt COPY . . RUN python manage.py collectstatic --noinput 2>/dev/null || true EXPOSE 8000 CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "4"]