Explorar el Código

换取国内镜像源加速apt-get

lxylxy123321 hace 1 semana
padre
commit
0641f5d3d9
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      backend/Dockerfile

+ 4 - 0
backend/Dockerfile

@@ -4,6 +4,10 @@ FROM docker.m.daocloud.io/library/python:3.10-slim
 
 WORKDIR /app
 
+# 换 Debian 国内镜像源(加速 apt-get)
+RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources && \
+    sed -i 's|security.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
+
 RUN apt-get update && apt-get install -y git openssh-client sshpass && rm -rf /var/lib/apt/lists/*
 
 COPY requirements.txt .