Files
jeanlucmakiola.de/Dockerfile
Jean-Luc Makiola 2665cd7f25 Build on node:22-slim (glibc) to fix musl native-dep failure
npm ci failed on node:22-alpine (musl): Astro 7's rolldown/oxc native
bindings pull @emnapi/core etc. that aren't resolved for musl. Build on
Debian glibc to match the lockfile's linux-x64-gnu deps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 13:48:56 +02:00

21 lines
676 B
Docker

# --- Build stage: produce static dist/ ---
# Debian (glibc), not alpine: Astro 7's Rust toolchain (rolldown/oxc) has
# flaky musl native bindings, and the lockfile is resolved for linux-x64-gnu.
FROM node:22-slim AS build
WORKDIR /app
# Install deps against the lockfile for reproducible builds.
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
# PUBLIC_* env vars are inlined at build time. In Coolify, set them as
# build-time variables so analytics is baked into the static output.
RUN npm run build
# --- Runtime stage: serve dist/ with Caddy ---
FROM caddy:2-alpine AS runtime
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist /srv
EXPOSE 80