Skip to content

Commit cb90c8e

Browse files
committed
Update angular-frontend.Dockerfile
1 parent 427bc44 commit cb90c8e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docker/angular-frontend.Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ RUN npm ci
88

99
# Copy source & build
1010
COPY . .
11-
# Angular 19 đã default prod; nhưng dùng cấu hình production vẫn OK
12-
RUN npm run build
11+
12+
# Build production và cố định output-path để tránh lệ thuộc tên project
13+
RUN npm run build -- --configuration=production --output-path=dist/app
1314

1415
# ====== Runtime stage ======
1516
FROM nginx:1.27-alpine
17+
1618
# file Nginx phục vụ SPA & fallback
1719
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
20+
1821
# copy artefact Angular
19-
COPY --from=build /app/dist/codecampus /usr/share/nginx/html
22+
COPY --from=build /app/dist/app /usr/share/nginx/html
2023

2124
EXPOSE 80
25+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -qO- http://localhost/ || exit 1
2226
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)