mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 04:51:34 +00:00
Fix Yarn 4.x deprecated commands in Dockerfile
- Replace --frozen-lockfile with --immutable in builder stage - Replace --frozen-lockfile --production with --immutable + autoclean in production stage - This resolves the Yarn 4.9.0 deprecation warnings and build failures
This commit is contained in:
parent
1656b67abe
commit
3ad0f9b538
10
Dockerfile
10
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Multi-stage build for Node.js frontend application
|
# Multi-stage build for Node.js frontend application
|
||||||
FROM node:22-alpine AS builder
|
FROM node:22.21.1-alpine3.20 AS builder
|
||||||
|
|
||||||
# Enable Corepack for Yarn 4.x
|
# Enable Corepack for Yarn 4.x
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
@ -11,7 +11,7 @@ WORKDIR /app
|
|||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN yarn install --frozen-lockfile
|
RUN yarn install --immutable
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@ -20,7 +20,7 @@ COPY . .
|
|||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
FROM node:22-alpine AS production
|
FROM node:22.21.1-alpine3.20 AS production
|
||||||
|
|
||||||
# Enable Corepack for Yarn 4.x
|
# Enable Corepack for Yarn 4.x
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
@ -35,8 +35,8 @@ WORKDIR /app
|
|||||||
# Copy package files
|
# Copy package files
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
|
|
||||||
# Install only production dependencies
|
# Install all dependencies first, then clean up dev dependencies
|
||||||
RUN yarn install --frozen-lockfile --production && yarn cache clean
|
RUN yarn install --immutable && yarn autoclean --force
|
||||||
|
|
||||||
# Copy built application from builder stage
|
# Copy built application from builder stage
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
|
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user