Commit 6c270b90 authored by Đoàn Quốc Huy's avatar Đoàn Quốc Huy

[tag]staging

parent 9be8aaaa
Pipeline #43333 passed with stages
in 11 minutes and 37 seconds
# Stage 1: Build FROM registry.gitlab.com/meusolutions/vcci-news:base AS builder
FROM registry.gitlab.com/meusolutions/vcci-news:base AS buildbase
# 'base' image đã có sẵn node_modules từ job trước (dùng làm cache)
# Copy toàn bộ source code (bao gồm package.json mới)
COPY . . COPY . .
# Bây giờ các script build sẽ chạy được
RUN npm run generate:api RUN npm run generate:api
RUN npm run build RUN npm run build
FROM node:22-alpine AS production
# Stage 2: Production Image (Không đổi)
FROM node:22-alpine AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
# Chỉ cài đặt production dependencies cho image cuối cùng RUN npm prune --production
RUN npm install --production
# Copy các file đã build từ stage 'buildbase' COPY --from=builder /app/.next ./.next
COPY --from=buildbase /app/.next ./.next COPY --from=builder /app/public ./public
COPY --from=buildbase /app/public ./public
EXPOSE 3000 EXPOSE 3000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment