diff --git a/Dockerfile b/Dockerfile index 65057fd..74fed19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,15 @@ WORKDIR /app ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 +# 配置国内镜像源加速 +RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \ + apt-get update && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# 设置pip国内镜像源 +RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple + # 复制依赖文件 COPY requirements.txt . @@ -24,4 +33,4 @@ RUN mkdir -p /app/logs EXPOSE 8000 # 启动命令 -CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--access-log"] \ No newline at end of file +CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--access-log"]