File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change 1- # Copy entrypoint script
2- COPY entrypoint.sh /entrypoint.sh
3- RUN chmod +x /entrypoint.sh
1+ # Stage 1: build Angular app
2+ FROM node:20-alpine AS build
3+ WORKDIR /app
4+ COPY package*.json ./
5+ RUN npm install
6+ COPY . .
7+ RUN npm run build --prod
48
5- ENTRYPOINT ["/entrypoint.sh"]
9+ # Stage 2: serve với Nginx
10+ FROM nginx:alpine
11+ COPY --from=build /app/dist/codecampus /usr/share/nginx/html
12+ # copy sẵn default nginx config nếu cần
13+ COPY nginx.conf /etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ services:
55 container_name : codecampus-frontend
66 image : ${DOCKERHUB_USER}/codecampus-frontend:${IMAGE_TAG:-latest}
77 restart : unless-stopped
8- ports : ["4200:4200 "]
8+ ports : ["4200:80 "]
99 volumes :
1010 # Dùng config local
1111 - ./config-local.json:/usr/share/nginx/html/config.json
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments