Commit 39f7ace1 authored by Đoàn Quốc Huy's avatar Đoàn Quốc Huy

[tag]staging

parent ccec9283
Pipeline #43306 failed with stages
in 29 seconds
# Stage 1: Build
FROM registry.gitlab.com/meusolutions/vcci-news:base AS buildbase 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 . .
# *** THÊM LỆNH NÀY ***
# Chạy 'npm install' một lần nữa để đồng bộ node_modules
# với file package.json mới và cài đặt devDependencies (như ts-node, orval)
RUN npm install
# 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
# Stage 2: Production Image (Không đổi)
FROM node:20-alpine AS build FROM node:20-alpine AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Chỉ cài đặt production dependencies cho image cuối cùng
RUN npm install --production RUN npm install --production
# Copy các file đã build từ stage 'buildbase'
COPY --from=buildbase /app/.next ./.next COPY --from=buildbase /app/.next ./.next
COPY --from=buildbase /app/public ./public COPY --from=buildbase /app/public ./public
......
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