From 8dd045d9fd2216d43f8d34955ec77330e6b2fcad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A3=E5=8D=97=E7=A7=91=E6=8A=80?= Date: Mon, 3 Mar 2025 22:34:48 +0800 Subject: [PATCH] Fix docker space (#179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update:调试docker编译缓存 * update:调试docker编译 * update:调试docker编译容量 * update:调试docker编译 --------- Co-authored-by: hrz <1710360675@qq.com> --- .github/workflows/docker-image.yml | 10 +++++++++- Dockerfile | 31 +----------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b957ee2e..1ed76391 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,6 +16,14 @@ jobs: issues: write steps: + - name: Check Disk Space + run: | + df -h + docker system df + - name: Clean up Docker resources + run: | + docker system prune -af + docker builder prune -af - name: Check out the repo uses: actions/checkout@v4 @@ -43,4 +51,4 @@ jobs: tags: | ghcr.io/${{ github.repository }}:${{ env.VERSION }} ghcr.io/${{ github.repository }}:latest - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9648b7b5..cd1fef9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,4 @@ -# 第一阶段:前端构建 - -FROM kalicyh/node:v18-alpine AS frontend-builder - -WORKDIR /app/ZhiKongTaiWeb - -# RUN corepack enable && yarn config set registry https://registry.npmmirror.com - -COPY ZhiKongTaiWeb/package.json ZhiKongTaiWeb/yarn.lock ./ - -RUN yarn install --frozen-lockfile - -COPY ZhiKongTaiWeb . -RUN yarn build - -# 第二阶段:构建 Python 依赖 - +# 第一阶段:构建 Python 依赖 FROM kalicyh/poetry:v3.10_xiaozhi AS builder WORKDIR /app @@ -24,19 +8,6 @@ COPY . . # 检查是否有缺失 RUN poetry install --no-root -# 使用清华源加速apt安装,该镜像内置所以注释 -# RUN rm -rf /etc/apt/sources.list.d/* && \ -# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \ -# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ -# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ -# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ -# apt-get update && \ -# apt-get install -y --no-install-recommends libopus0 ffmpeg && \ -# apt-get clean - -# 从构建阶段复制虚拟环境和前端构建产物 -COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui - # 设置虚拟环境路径 ENV PATH="/app/.venv/bin:$PATH"