fix(detail+docker): per-aspect template preview + Debian frontend base
- Template detail page now shows the render matching the SELECTED aspect (poster +
preview video) instead of the 16:9 cover cropped into a 9:16/1:1 box. TemplateVariant
carries per-aspect image/previewVideo; fetchTemplateVariants + the detail page wire them.
- AppShowcase3D ships a distinct preview video per aspect (seed PERASPECT_VIDEO).
- Frontend Dockerfile: Alpine -> node:20-slim (glibc). Fixes next-swc ("ld-linux..."
load failure that broke `next build` once libc6-compat was removed) AND the original
CI Alpine-CDN issue. Healthcheck switched to node (slim has no wget).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-10
@@ -1,9 +1,8 @@
|
||||
# ── Stage 1: install dependencies ────────────────────────────────────────────
|
||||
FROM mirror.soroushasadi.com/node:20-alpine AS deps
|
||||
# NOTE: do NOT `apk add libc6-compat` here — the deps stage only runs `npm ci`
|
||||
# (which doesn't need it) and the build/runtime stages omit it anyway. Pulling it
|
||||
# reaches Alpine's public CDN (dl-cdn.alpinelinux.org), which is unreachable from
|
||||
# the CI server (only the Nexus mirror is) and fails the whole build.
|
||||
FROM mirror.soroushasadi.com/node:20-slim AS deps
|
||||
# Debian (glibc) base on purpose: Alpine (musl) needs `libc6-compat` for next-swc,
|
||||
# which is only on the geo-blocked Alpine CDN (unreachable from the CI server).
|
||||
# Debian ships glibc, so next-swc's gnu binary loads natively — no apk, no CDN.
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
@@ -21,7 +20,7 @@ RUN for i in 1 2 3 4 5; do \
|
||||
echo "npm ci failed after 5 attempts" && exit 1
|
||||
|
||||
# ── Stage 2: build ───────────────────────────────────────────────────────────
|
||||
FROM mirror.soroushasadi.com/node:20-alpine AS builder
|
||||
FROM mirror.soroushasadi.com/node:20-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
@@ -54,15 +53,15 @@ ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# ── Stage 3: production runner ────────────────────────────────────────────────
|
||||
FROM mirror.soroushasadi.com/node:20-alpine AS runner
|
||||
FROM mirror.soroushasadi.com/node:20-slim AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Create a non-root user (security best practice)
|
||||
RUN addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 nextjs
|
||||
# Create a non-root user (security best practice). Debian uses groupadd/useradd.
|
||||
RUN groupadd --system --gid 1001 nodejs \
|
||||
&& useradd --system --uid 1001 --gid nodejs nextjs
|
||||
|
||||
# Copy public assets
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
Reference in New Issue
Block a user