-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (21 loc) · 757 Bytes
/
Dockerfile
File metadata and controls
32 lines (21 loc) · 757 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
30
31
32
# Stage 1: Build the Angular app
# Use the official Node.js 20 image as the base
FROM node:20 AS build
# Install PNPM globally
RUN npm install -g pnpm
# Set the working directory inside the container
WORKDIR /app
# Copy the pnpm-lock.yaml and package.json files to the working directory
COPY pnpm-lock.yaml package.json ./
# Install the app dependencies using PNPM
RUN pnpm install --frozen-lockfile
# Copy the entire app source code to the working directory
COPY . .
# Build the Angular app for production using PNPM
RUN pnpm run build:prod
# Stage 2: Serve the Angular app using Nginx
FROM nginx:latest
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]