fix: use Debian base for deps stage to match runner for binary compatibility

CRITICAL REGRESSION: Production container crash-looping with:
"Error: libc.musl-x86_64.so.1: cannot open shared object file"

Root cause identified:
Commit dafdfdd2 (3D printing support) changed runner stage from:
  FROM node:18-alpine  →  FROM node:18-slim
to add OpenSCAD (not available in Alpine repos).

However, the deps stage was NOT updated and remained Alpine-based,
causing a binary incompatibility:
- deps stage (Alpine/musl) compiles better-sqlite3 for musl libc
- runner stage (Debian/glibc) cannot run musl-compiled binaries

Solution:
Changed deps stage from node:18-alpine to node:18-slim to match
runner, ensuring better-sqlite3 is compiled for the correct target.

Both stages must now use Debian because OpenSCAD is required for
3D printing functionality and is not available in Alpine.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-03 11:24:17 -06:00
parent af5308bcbe
commit f8fe6e4a41
1 changed files with 7 additions and 2 deletions

View File

@ -45,11 +45,16 @@ RUN cd apps/web && npx @pandacss/dev
RUN turbo build --filter=@soroban/web RUN turbo build --filter=@soroban/web
# Production dependencies stage - install only runtime dependencies # Production dependencies stage - install only runtime dependencies
FROM node:18-alpine AS deps # IMPORTANT: Must use same base as runner stage for binary compatibility (better-sqlite3)
FROM node:18-slim AS deps
WORKDIR /app WORKDIR /app
# Install build tools temporarily for better-sqlite3 installation # Install build tools temporarily for better-sqlite3 installation
RUN apk add --no-cache python3 py3-setuptools make g++ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Install pnpm # Install pnpm
RUN npm install -g pnpm@9.15.4 RUN npm install -g pnpm@9.15.4