Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
6c270b90
Commit
6c270b90
authored
Nov 04, 2025
by
Đoàn Quốc Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tag]staging
parent
9be8aaaa
Pipeline
#43333
passed with stages
in 11 minutes and 37 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
build.Dockerfile
.docker/build.Dockerfile
+8
-15
No files found.
.docker/build.Dockerfile
View file @
6c270b90
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment