-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 718 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (20 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Dockerfile for Angular v21 app hosted with Nginx
# Step 1: Build the Angular project
FROM node:24 AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build -- --output-path=dist --configuration production
# Step 2: Serve with Nginx
FROM nginx:stable-alpine
# Remove default nginx static files
RUN rm -rf /usr/share/nginx/html/*
# Copy all files from dist root
COPY --from=build /app/dist/* /usr/share/nginx/html/
# Also copy contents of browser folder directly into nginx www folder
COPY --from=build /app/dist/*/browser/ /usr/share/nginx/html/
# Copy default nginx config (optional)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]