-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 709 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (19 loc) · 709 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
# Stage 1: Build the Angular app
FROM node:18-alpine AS build
WORKDIR /app
# Copy package.json and package-lock.json first for caching
COPY package*.json ./
RUN npm install
# Copy the rest of the app and build
COPY . .
RUN npm run build -- --configuration production
# Stage 2: Serve the app with Nginx
FROM nginx:alpine
# Copy the built app from Stage 1
# Note: For Angular 17+ with the application builder, the output path is usually dist/<project-name>/browser
COPY --from=build /app/dist/formbuilder/browser /usr/share/nginx/html
# Copy a custom nginx proxy config if needed (optional)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]