tanlie пре 4 дана
родитељ
комит
20ca82bf22
1 измењених фајлова са 7 додато и 15 уклоњено
  1. 7 15
      Dockerfile

+ 7 - 15
Dockerfile

@@ -1,24 +1,16 @@
-# syntax=docker/dockerfile:1.4
 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
-
-# Copy only requirements first to maximise layer cache
 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 . .
 
 EXPOSE 5000
-CMD ["uwsgi", "--ini", "/app/uwsgi.ini"]
+
+CMD ["uwsgi", "--ini", "/app/uwsgi.ini"]