fix: switch Docker images from Alpine to Debian slim for native addon compatibility
Alpine (musl libc) is incompatible with matrix-sdk-crypto-nodejs native binary which requires glibc's ld-linux-x86-64.so.2. Switched all Node.js Dockerfiles to node:24-slim (Debian/glibc). Also fixed docker-compose.matrix.yml network naming from undefined mosaic-network to mosaic-internal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
# Enable BuildKit features for cache mounts
|
||||
|
||||
# Base image for all stages
|
||||
FROM node:24-alpine AS base
|
||||
# Uses Debian slim (glibc) for consistency with API/orchestrator and to prevent
|
||||
# future native addon compatibility issues with Alpine's musl libc.
|
||||
FROM node:24-slim AS base
|
||||
|
||||
# Install pnpm globally
|
||||
RUN corepack enable && corepack prepare pnpm@10.27.0 --activate
|
||||
@@ -75,7 +77,7 @@ RUN mkdir -p ./apps/web/public
|
||||
# ======================
|
||||
# Production stage
|
||||
# ======================
|
||||
FROM node:24-alpine AS production
|
||||
FROM node:24-slim AS production
|
||||
|
||||
# Remove npm (unused in production — we use pnpm) to reduce attack surface
|
||||
RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
|
||||
@@ -84,10 +86,11 @@ RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
|
||||
RUN corepack enable && corepack prepare pnpm@10.27.0 --activate
|
||||
|
||||
# Install dumb-init for proper signal handling
|
||||
RUN apk add --no-cache dumb-init
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
||||
RUN groupadd -g 1001 nodejs && useradd -m -u 1001 -g nodejs nextjs
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user