From aac0f297df469edaff2a1e669eb65ded44ba8282 Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Wed, 20 Aug 2025 15:53:33 +0800 Subject: [PATCH] build: try to build web separately. --- .github/workflows/build-and-push.yml | 12 ++++++++++++ installer/Dockerfile | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index ed78a5733..f0f365ed5 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -90,6 +90,12 @@ jobs: registry: ${{ secrets.FIT2CLOUD_REGISTRY_HOST }} username: ${{ secrets.FIT2CLOUD_REGISTRY_USERNAME }} password: ${{ secrets.FIT2CLOUD_REGISTRY_PASSWORD }} + - name: Build Web + run: | + docker buildx build --target web-build --output type=local,dest=./web-build-output . -f installer/Dockerfile + rm -rf ./ui + cp -r ./web-build-output/ui ./ + rm -rf ./web-build-output - name: Docker Buildx (build-and-push) run: | sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -m @@ -150,6 +156,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build Web + run: | + docker buildx build --target web-build --output type=local,dest=./web-build-output . -f installer/Dockerfile + rm -rf ./ui + cp -r ./web-build-output/ui ./ + rm -rf ./web-build-output - name: Docker Buildx (build-and-push) run: | sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -m diff --git a/installer/Dockerfile b/installer/Dockerfile index a05e938fc..bce62fa76 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -1,6 +1,6 @@ FROM node:24-alpine AS web-build COPY ui ui -RUN cd ui && \ +RUN cd ui && ls -la && if [ -d "dist" ]; then exit 0; fi && \ npm install --prefer-offline --no-audit && \ npm install -D concurrently && \ NODE_OPTIONS="--max-old-space-size=4096" npx concurrently "npm run build" "npm run build-chat" && \