Try making arm64 image
Some checks failed
Build & Push Docker Image / build (push) Failing after 1m9s
Some checks failed
Build & Push Docker Image / build (push) Failing after 1m9s
This commit is contained in:
@@ -11,6 +11,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -45,6 +48,10 @@ jobs:
|
|||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
# Build multi-arch images for amd64 and arm64
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
|
build-args: |
|
||||||
|
BUILD_FROM_SOURCE=${{ env.BUILD_FROM_SOURCE }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
13
Dockerfile
13
Dockerfile
@@ -3,6 +3,9 @@ FROM node:20-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
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* ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
@@ -12,8 +15,12 @@ RUN npm run build
|
|||||||
# ── Stage 2: Production image ───────────────────────────────────────────────
|
# ── Stage 2: Production image ───────────────────────────────────────────────
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
|
|
||||||
# better-sqlite3 needs build tools for native compilation
|
# Allow forcing build from source (useful when prebuilt binaries are not available)
|
||||||
RUN apk add --no-cache python3 make g++
|
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
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -21,7 +28,7 @@ COPY package.json package-lock.json* ./
|
|||||||
RUN npm ci --omit=dev && npm cache clean --force
|
RUN npm ci --omit=dev && npm cache clean --force
|
||||||
|
|
||||||
# Remove build tools after install to keep image smaller
|
# 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 code
|
||||||
COPY server/ ./server/
|
COPY server/ ./server/
|
||||||
|
|||||||
Reference in New Issue
Block a user