Просмотр исходного кода

Dockerfile 为Poetry指定镜像源

xiaoqinghui 1 месяц назад
Родитель
Сommit
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
     && pip install --no-cache-dir poetry
 
 
 COPY pyproject.toml poetry.lock ./
 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 . .
 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
     && pip install --no-cache-dir poetry
 
 
 COPY pyproject.toml poetry.lock ./
 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 . .
 COPY . .