FROM python:3.11-slim # Install system utilities, compilation tools, and PostgreSQL libraries RUN apt-get update && apt-get install -y \ curl \ gcc \ build-essential \ python3-dev \ libpq-dev \ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace # Copy dependencies first to maximize layer caching efficiency COPY requirements.txt . # Upgrade pip and install the requirements file RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy everything else from your root folder COPY . . # Environment settings required for Django/Gunicorn runtime ENV PYTHONUNBUFFERED=1 ENV PORT=7860 # Enforce execution permissions on the entrypoint script RUN chmod +x setup.sh EXPOSE 7860 CMD ["./setup.sh"]