|
@@ -1,24 +1,16 @@
|
|
|
-# syntax=docker/dockerfile:1.4
|
|
|
|
|
FROM python:3.12-slim
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
-# Allow configuring a faster pip index at build time (default: TUNA mirror)
|
|
|
|
|
-ARG PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
|
-ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
|
- PYTHONUNBUFFERED=1 \
|
|
|
|
|
- PIP_INDEX_URL=$PIP_INDEX_URL
|
|
|
|
|
-
|
|
|
|
|
WORKDIR /app
|
|
WORKDIR /app
|
|
|
-
|
|
|
|
|
-# Copy only requirements first to maximise layer cache
|
|
|
|
|
COPY requirements.txt ./
|
|
COPY requirements.txt ./
|
|
|
|
|
|
|
|
-# Use BuildKit cache mount for pip to avoid re-downloading wheels between builds.
|
|
|
|
|
-# Build with: DOCKER_BUILDKIT=1 docker build --build-arg PIP_INDEX_URL=... -t ginger .
|
|
|
|
|
-RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
- python -m pip install --upgrade pip setuptools wheel && \
|
|
|
|
|
- python -m pip install --prefer-binary -r requirements.txt
|
|
|
|
|
|
|
+RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
|
|
|
|
|
+ pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn
|
|
|
|
|
+
|
|
|
|
|
+RUN python -m pip install --upgrade pip \
|
|
|
|
|
+ && python -m pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
COPY . .
|
|
COPY . .
|
|
|
|
|
|
|
|
EXPOSE 5000
|
|
EXPOSE 5000
|
|
|
-CMD ["uwsgi", "--ini", "/app/uwsgi.ini"]
|
|
|
|
|
|
|
+
|
|
|
|
|
+CMD ["uwsgi", "--ini", "/app/uwsgi.ini"]
|