build: try to build web separately.

This commit is contained in:
liqiang-fit2cloud 2025-08-20 15:53:33 +08:00
parent ee494a5bc0
commit aac0f297df
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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" && \