40 lines
1.2 KiB
Docker
40 lines
1.2 KiB
Docker
|
|
FROM mirror-docker.runflare.com/library/python:3.10
|
||
|
|
|
||
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||
|
|
ENV PYTHONUNBUFFERED=1
|
||
|
|
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Debian mirror configuration
|
||
|
|
RUN rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* && \
|
||
|
|
printf '%s\n' \
|
||
|
|
'deb https://mirror-linux.runflare.com/debian/ bookworm main contrib non-free non-free-firmware' \
|
||
|
|
'deb https://mirror-linux.runflare.com/debian/ bookworm-updates main contrib non-free non-free-firmware' \
|
||
|
|
'deb https://mirror-linux.runflare.com/debian-security/ bookworm-security main contrib non-free non-free-firmware' \
|
||
|
|
'' \
|
||
|
|
> /etc/apt/sources.list
|
||
|
|
|
||
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
|
|
default-libmysqlclient-dev \
|
||
|
|
build-essential \
|
||
|
|
pkg-config \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
COPY requirements.txt constraints.txt /app/
|
||
|
|
|
||
|
|
RUN PIP_CONSTRAINT=/app/constraints.txt \
|
||
|
|
pip install \
|
||
|
|
--prefer-binary \
|
||
|
|
--index-url https://mirror-pypi.runflare.com/simple \
|
||
|
|
--trusted-host mirror-pypi.runflare.com \
|
||
|
|
-r requirements.txt
|
||
|
|
|
||
|
|
COPY entrypoint.sh /app/entrypoint.sh
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
EXPOSE 8000
|
||
|
|
|
||
|
|
ENTRYPOINT ["sh", "/app/entrypoint.sh"]
|
||
|
|
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"]
|