260323:1443 fix CI : Deploy : Turbopack Build Error #01
This commit is contained in:
+9
-8
@@ -15,7 +15,7 @@
|
|||||||
# =========================
|
# =========================
|
||||||
# Stage 1: Install Dependencies
|
# 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
|
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
|
# 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
|
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
|
# Stage 3: Production Runtime
|
||||||
# =========================
|
# =========================
|
||||||
FROM node:22-alpine AS production
|
FROM node:22-slim AS production
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -85,12 +85,13 @@ ENV NODE_ENV=production
|
|||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=0.0.0.0
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user (Debian version)
|
||||||
RUN addgroup -g 1001 -S nextjs && \
|
RUN groupadd -g 1001 nextjs && \
|
||||||
adduser -S nextjs -u 1001
|
useradd -u 1001 -g 1001 -m -s /bin/bash nextjs
|
||||||
|
|
||||||
# Install curl for healthcheck
|
# Install curl for healthcheck (Debian version)
|
||||||
RUN apk add --no-cache curl
|
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 flat node_modules from pnpm deploy (no symlinks, Docker-safe)
|
||||||
COPY --from=build --chown=nextjs:nextjs /deploy/node_modules ./node_modules
|
COPY --from=build --chown=nextjs:nextjs /deploy/node_modules ./node_modules
|
||||||
|
|||||||
@@ -37,12 +37,7 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 5. Turbopack config for Next.js 16
|
// 5. Webpack config (fallback for Turbopack)
|
||||||
turbopack: {
|
|
||||||
// Empty config to silence Turbopack warnings
|
|
||||||
},
|
|
||||||
|
|
||||||
// 5.1. Webpack config (fallback for Turbopack)
|
|
||||||
webpack: (config, { dev, isServer }) => {
|
webpack: (config, { dev, isServer }) => {
|
||||||
if (!dev && !isServer) {
|
if (!dev && !isServer) {
|
||||||
config.stats = {
|
config.stats = {
|
||||||
|
|||||||
Reference in New Issue
Block a user