From ba486f4f8c52701317838eaf03154f36273d345f Mon Sep 17 00:00:00 2001 From: continuist Date: Sun, 21 Sep 2025 13:48:21 -0400 Subject: [PATCH] Try further space optimizations --- .forgejo/workflows/ci.yml | 28 +++++++++++++++++++++++++++- frontend/Dockerfile | 4 ++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 8d525e6..a354e13 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -197,9 +197,31 @@ jobs: --password-stdin \ "${{ secrets.REGISTRY_HOST }}" + - name: Disk preflight diagnostic + run: | + echo "=== Podman storage info ===" + podman --remote system df + echo "=== Podman graph root ===" + podman --remote info --format '{{.Store.GraphRoot}}' + echo "=== Disk space info ===" + df -h /home/ci-service /tmp /var/tmp 2>/dev/null || df -h /tmp /var/tmp + echo "=== Inode info ===" + df -i /home/ci-service /tmp /var/tmp 2>/dev/null || df -i /tmp /var/tmp + + - name: Safe storage pruning + run: podman --remote system prune -f + - name: Build frontend container image run: | - podman --remote build --no-cache \ + # Create temp directory on larger filesystem + TMP_DIR="/home/ci-service/tmp" + if [ ! -d "$TMP_DIR" ]; then + TMP_DIR="$(mktemp -d)" + fi + export TMPDIR="$TMP_DIR" + + podman --remote build \ + --tmpdir "$TMP_DIR" \ --build-arg NEXT_PUBLIC_API_HOST=${{ secrets.PROD_BACKEND_HOST }} \ --build-arg NEXT_PUBLIC_API_PORT=${{ secrets.PROD_BACKEND_PORT }} \ -f frontend/Dockerfile \ @@ -207,6 +229,10 @@ jobs: -t "$FRONTEND_IMAGE:latest" \ frontend + - name: Cleanup storage + if: always() + run: podman --remote system prune -f + - name: Push frontend container image run: | podman --remote push "$FRONTEND_IMAGE:${{ github.sha }}" diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6c5cd50..512b13b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -2,9 +2,9 @@ FROM docker.io/node:20-slim AS builder WORKDIR /app -# Install dependencies with minimal footprint +# Install dependencies with minimal footprint using package-lock.json for deterministic builds COPY package*.json ./ -RUN npm cache clean --force && npm install --no-audit --no-fund --prefer-offline +RUN npm ci --no-audit --no-fund --prefer-offline # Copy app source COPY . .