diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6dcd175..662a415 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -15,7 +15,7 @@ # ========================= # Stage 1: Install Dependencies # ========================= -FROM node:22-alpine AS deps +FROM node:22-slim AS deps RUN corepack enable && corepack prepare pnpm@10.32.1 --activate @@ -31,7 +31,7 @@ RUN pnpm install --frozen-lockfile --filter lcbp3-frontend... # ========================= # Stage 2: Build Application # ========================= -FROM node:22-alpine AS build +FROM node:22-slim AS build RUN corepack enable && corepack prepare pnpm@10.32.1 --activate @@ -76,7 +76,7 @@ RUN pnpm --filter lcbp3-frontend deploy /deploy --prod --legacy # ========================= # Stage 3: Production Runtime # ========================= -FROM node:22-alpine AS production +FROM node:22-slim AS production WORKDIR /app @@ -85,12 +85,13 @@ ENV NODE_ENV=production ENV HOSTNAME=0.0.0.0 ENV PORT=3000 -# Create non-root user -RUN addgroup -g 1001 -S nextjs && \ - adduser -S nextjs -u 1001 +# Create non-root user (Debian version) +RUN groupadd -g 1001 nextjs && \ + useradd -u 1001 -g 1001 -m -s /bin/bash nextjs -# Install curl for healthcheck -RUN apk add --no-cache curl +# Install curl for healthcheck (Debian version) +RUN apt-get update && apt-get install -y --no-install-recommends curl && \ + rm -rf /var/lib/apt/lists/* # Copy flat node_modules from pnpm deploy (no symlinks, Docker-safe) COPY --from=build --chown=nextjs:nextjs /deploy/node_modules ./node_modules diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 36e540f..13adf8b 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -37,12 +37,7 @@ const nextConfig = { }, */ - // 5. Turbopack config for Next.js 16 - turbopack: { - // Empty config to silence Turbopack warnings - }, - - // 5.1. Webpack config (fallback for Turbopack) + // 5. Webpack config (fallback for Turbopack) webpack: (config, { dev, isServer }) => { if (!dev && !isServer) { config.stats = {