From ea665e5da874a194295a756264414c84abc4545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Tue, 3 Mar 2026 09:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20fix=20docker=20build=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0b6646..34bda26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,15 @@ # Multi-stage Dockerfile for frpc-hub -# Stage 1: Build frontend -FROM node:20-alpine AS frontend-builder +# Stage 1: Build frontend (always on native amd64 to avoid QEMU OOM on arm builds) +FROM --platform=linux/amd64 node:22-alpine AS frontend-builder WORKDIR /app # Copy frontend source -COPY site/package*.json site/pnpm-lock.yaml* ./ -# Install dependencies (try pnpm first, fallback to npm) -RUN if [ -f pnpm-lock.yaml ]; then \ - npm install -g pnpm && pnpm install; \ - else \ - npm install; \ - fi +COPY site/package*.json site/pnpm-lock.yaml ./ +RUN npm install -g pnpm@10 && pnpm install --frozen-lockfile COPY site/ ./ -RUN if [ -f pnpm-lock.yaml ]; then \ - pnpm run build; \ - else \ - npm run build; \ - fi +RUN pnpm run build # Stage 2: Build backend FROM golang:1.25-alpine AS backend-builder