This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
# 1. Base image
|
||||
FROM node:20-alpine AS base
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# 2. Install dependencies
|
||||
# 2. Install dependencies (bao gồm dev)
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
RUN npm ci --include=dev
|
||||
|
||||
# 3. Build the app
|
||||
FROM base AS build
|
||||
@@ -17,7 +16,7 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# 4. Final runtime image
|
||||
FROM base AS runner
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
Reference in New Issue
Block a user