Try making arm64 image
Some checks failed
Build & Push Docker Image / build (push) Failing after 1m9s

This commit is contained in:
2026-02-27 14:42:40 +01:00
parent 0d48f52d3b
commit ef5790b44d
2 changed files with 17 additions and 3 deletions

View File

@@ -11,6 +11,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
# Set to 'true' if you need to compile native modules from source (e.g. better-sqlite3 on arm)
BUILD_FROM_SOURCE: 'false'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -45,6 +48,10 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
# Build multi-arch images for amd64 and arm64
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BUILD_FROM_SOURCE=${{ env.BUILD_FROM_SOURCE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -3,6 +3,9 @@ FROM node:20-alpine AS builder
WORKDIR /app
# Install build tools needed for native modules and frontend build
RUN apk add --no-cache python3 build-base sqlite-dev
COPY package.json package-lock.json* ./
RUN npm ci
@@ -12,8 +15,12 @@ RUN npm run build
# ── Stage 2: Production image ───────────────────────────────────────────────
FROM node:20-alpine
# better-sqlite3 needs build tools for native compilation
RUN apk add --no-cache python3 make g++
# 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
@@ -21,7 +28,7 @@ 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 python3 make g++
RUN apk del build-base python3
# Copy server code
COPY server/ ./server/