perf: switch to node:20-alpine base images
Docker Build (ARM64) / Build & Push (push) Failing after 5s

This commit is contained in:
2026-06-24 18:32:35 +02:00
parent 32188d93b4
commit 460671e753
2 changed files with 15 additions and 15 deletions
+7 -7
View File
@@ -2,9 +2,9 @@
# Builds the MCP server with SQLite persistence # Builds the MCP server with SQLite persistence
# Stage 1: Build backend (TypeScript compilation + native modules) # Stage 1: Build backend (TypeScript compilation + native modules)
FROM node:20-slim AS builder FROM node:20-alpine AS builder
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* RUN apk add --no-cache python3 make g++
WORKDIR /app WORKDIR /app
@@ -16,12 +16,12 @@ COPY tsconfig.json ./
RUN npm run build:server RUN npm run build:server
# Stage 2: Production MCP Server # Stage 2: Production MCP Server
FROM node:20-slim AS production FROM node:20-alpine AS production
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* RUN apk add --no-cache python3 make g++
RUN addgroup --system --gid 1001 nodejs && \ RUN addgroup -S -g 1001 nodejs && \
adduser --system --uid 1001 --gid 1001 nodejs adduser -S -u 1001 -G nodejs nodejs
WORKDIR /app WORKDIR /app
@@ -29,7 +29,7 @@ COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
# Remove build tools after native modules are compiled # Remove build tools after native modules are compiled
RUN apt-get purge -y python3 make g++ && apt-get autoremove -y RUN apk del python3 make g++
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
+8 -8
View File
@@ -2,7 +2,7 @@
# Provides the web interface, REST API, and SQLite persistence # Provides the web interface, REST API, and SQLite persistence
# Stage 1: Build frontend # Stage 1: Build frontend
FROM node:20-slim AS frontend-builder FROM node:20-alpine AS frontend-builder
WORKDIR /app WORKDIR /app
@@ -14,9 +14,9 @@ COPY vite.config.js ./
RUN npm run build:frontend RUN npm run build:frontend
# Stage 2: Build backend (TypeScript compilation + native modules) # Stage 2: Build backend (TypeScript compilation + native modules)
FROM node:20-slim AS backend-builder FROM node:20-alpine AS backend-builder
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* RUN apk add --no-cache python3 make g++
WORKDIR /app WORKDIR /app
@@ -28,12 +28,12 @@ COPY tsconfig.json ./
RUN npm run build:server RUN npm run build:server
# Stage 3: Production Canvas Server # Stage 3: Production Canvas Server
FROM node:20-slim AS production FROM node:20-alpine AS production
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* RUN apk add --no-cache python3 make g++
RUN addgroup --system --gid 1001 nodejs && \ RUN addgroup -S -g 1001 nodejs && \
adduser --system --uid 1001 --gid 1001 nodejs adduser -S -u 1001 -G nodejs nodejs
WORKDIR /app WORKDIR /app
@@ -41,7 +41,7 @@ COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
# Remove build tools after native modules are compiled # Remove build tools after native modules are compiled
RUN apt-get purge -y python3 make g++ && apt-get autoremove -y RUN apk del python3 make g++
COPY --from=backend-builder /app/dist ./dist COPY --from=backend-builder /app/dist ./dist
COPY --from=frontend-builder /app/dist/frontend ./dist/frontend COPY --from=frontend-builder /app/dist/frontend ./dist/frontend