This commit is contained in:
g
2026-01-11 07:25:27 +00:00
parent 24c752d52b
commit 027cc49430
9 changed files with 7190 additions and 18 deletions

View File

@@ -7,10 +7,13 @@ WORKDIR /app
# Install git early for commit hash
RUN apk add --no-cache git
COPY package.json package-lock.json ./
# Install pnpm
RUN npm install -g pnpm
# Install dependencies with increased memory limit for Next.js 16
RUN npm install --force
COPY package.json pnpm-lock.yaml ./
# Install dependencies with pnpm
RUN pnpm install --frozen-lockfile
COPY . .
@@ -25,7 +28,7 @@ ENV API_HOSTNAME=internal-api.inboxi.ng
# Build the Next.js application with increased memory for Turbopack
# Next.js 16 uses Turbopack by default which may need more memory
RUN echo "Building with GIT_COMMIT_SHA=$(cat /app/git_commit_sha)" && \
NODE_OPTIONS='--max_old_space_size=4096' NEXT_TELEMETRY_DISABLED=1 npm run build
NODE_OPTIONS='--max_old_space_size=4096' NEXT_TELEMETRY_DISABLED=1 pnpm run build
# ---- Production Stage ----
# Use Node 20 for production as well to match builder
@@ -37,7 +40,7 @@ WORKDIR /app
RUN mkdir -p /app/public
# Copy only necessary files from builder
COPY --from=builder /app/package.json /app/package-lock.json ./
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
@@ -57,4 +60,4 @@ ENV API_HOSTNAME=internal-api.inboxi.ng
# The file is available at /app/git_commit_sha if needed
# Start Next.js server
CMD ["npm", "run", "start"]
CMD ["pnpm", "run", "start"]