diff --git a/backend/Dockerfile b/backend/Dockerfile index ad0891c..ce0a9d5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -11,11 +11,10 @@ RUN apt-get update && \ pkg-config \ && rm -rf /var/lib/apt/lists/* - -COPY requirements.txt . -RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple - COPY . . + +RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple + CMD ["sh", "-c", "sleep 10 && python manage.py runserver 0.0.0.0:8000"] # 默认命令,开发和生产通过 docker-compose 覆盖 diff --git a/web/Dockerfile b/web/Dockerfile index 529ce1a..afa5dc2 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -33,6 +33,8 @@ RUN pnpm store prune && rm -rf $(pnpm store path) && \ rm -rf node_modules .npmrc package-lock.json pnpm-lock.yaml .pnpm-store .turbo && \ find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + +RUN npm run clean + RUN yes | pnpm recursive install # 设置前端工作目录(根据实际情况修改)