Переглянути джерело

Dockerfile 为Poetry指定镜像源

xiaoqinghui 1 місяць тому
батько
коміт
2257ac5cfb
2 змінених файлів з 6 додано та 2 видалено
  1. 3 1
      alien_gateway/Dockerfile
  2. 3 1
      alien_store/Dockerfile

+ 3 - 1
alien_gateway/Dockerfile

@@ -10,7 +10,9 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
     && pip install --no-cache-dir poetry
 
 COPY pyproject.toml poetry.lock ./
-RUN poetry install --no-root --no-interaction --no-ansi
+
+RUN poetry source add --priority=primary tsinghua https://pypi.tuna.tsinghua.edu.cn/simple || true \
+    && poetry install --no-root --no-interaction --no-ansi
 
 COPY . .
 

+ 3 - 1
alien_store/Dockerfile

@@ -10,7 +10,9 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
     && pip install --no-cache-dir poetry
 
 COPY pyproject.toml poetry.lock ./
-RUN poetry install --no-root --no-interaction --no-ansi
+
+RUN poetry source add --priority=primary tsinghua https://pypi.tuna.tsinghua.edu.cn/simple || true \
+    && poetry install --no-root --no-interaction --no-ansi
 
 COPY . .