ARG BASE_IMAGE=mirror-docker.runflare.com/library/python:3.10-slim-bookworm FROM ${BASE_IMAGE} ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_NO_CACHE_DIR=1 ARG APT_MIRROR=mirror-linux.runflare.com/debian ARG APT_SECURITY_MIRROR=mirror-linux.runflare.com/debian-security ARG PIP_INDEX_URL=https://mirror-pypi.runflare.com/simple ARG PIP_TRUSTED_HOST=mirror-pypi.runflare.com WORKDIR /app # Route Debian packages through the requested mirror. RUN printf '%s\n' \ "deb https://${APT_MIRROR} bookworm main contrib non-free non-free-firmware" \ "deb https://${APT_MIRROR} bookworm-updates main contrib non-free non-free-firmware" \ "deb https://${APT_SECURITY_MIRROR} bookworm-security main contrib non-free non-free-firmware" \ > /etc/apt/sources.list \ && apt-get update \ && apt-get install -y --no-install-recommends \ build-essential \ default-libmysqlclient-dev \ pkg-config \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/requirements.txt # Route Python packages through the requested mirror. RUN pip config set global.index-url "${PIP_INDEX_URL}" \ && pip config set global.trusted-host "${PIP_TRUSTED_HOST}" \ && pip install -r /app/requirements.txt COPY entrypoint.sh /app/entrypoint.sh COPY . /app RUN chmod +x /app/entrypoint.sh EXPOSE 8000 ENTRYPOINT ["sh", "/app/entrypoint.sh"] CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"]