Dockerfile opt. experiments
All checks were successful
Next.js App CI / docker (push) Successful in 5m51s
All checks were successful
Next.js App CI / docker (push) Successful in 5m51s
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
FROM node:20-alpine AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
# Stage 2: Builder
|
||||
# This stage installs dependencies and builds the Next.js application.
|
||||
@@ -44,11 +44,11 @@ COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
||||
|
||||
# Install ONLY production dependencies.
|
||||
# The pnpm CLI is already available from the 'base' stage.
|
||||
RUN pnpm install --prod
|
||||
RUN pnpm install --prod --frozen-lockfile
|
||||
|
||||
# Copy the built Next.js application and public assets
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
|
||||
# Change ownership to the non-root user
|
||||
RUN chown -R nextjs:nodejs /app
|
||||
|
||||
Reference in New Issue
Block a user