From ffb7a45bfcd1f4404771bf6181c3361f2e57adfb Mon Sep 17 00:00:00 2001 From: Miichelle Date: Fri, 27 Feb 2026 14:50:09 +0100 Subject: [PATCH] Try arm64 build --- Dockerfile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d0818e..5145aee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,38 @@ # ── Stage 1: Build frontend ────────────────────────────────────────────────── -FROM node:20-alpine AS builder +FROM node:20-bullseye-slim AS builder WORKDIR /app -# Install build tools needed for native modules and frontend build -RUN apk add --no-cache python3 build-base sqlite-dev +# Install build tools and sqlite headers for native modules +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 build-essential libsqlite3-dev ca-certificates \ + && rm -rf /var/lib/apt/lists/* COPY package.json package-lock.json* ./ RUN npm ci COPY . . RUN npm run build +# Produce production node_modules (compile native modules here for the target arch) +RUN npm ci --omit=dev && npm cache clean --force # ── Stage 2: Production image ─────────────────────────────────────────────── -FROM node:20-alpine + +FROM node:20-bullseye-slim # Allow forcing build from source (useful when prebuilt binaries are not available) ARG BUILD_FROM_SOURCE=false ENV npm_config_build_from_source=${BUILD_FROM_SOURCE} -# Install build tools and sqlite dev headers for compiling native modules -RUN apk add --no-cache python3 build-base sqlite-dev - WORKDIR /app -COPY package.json package-lock.json* ./ -RUN npm ci --omit=dev && npm cache clean --force - -# Remove build tools after install to keep image smaller -RUN apk del build-base python3 +# Copy production node_modules and built frontend from builder stage +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist # Copy server code COPY server/ ./server/ -# Copy built frontend from builder stage -COPY --from=builder /app/dist ./dist - # Create uploads directory RUN mkdir -p uploads/avatars uploads/branding