-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
38 lines (26 loc) · 1.03 KB
/
dockerfile
File metadata and controls
38 lines (26 loc) · 1.03 KB
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
33
34
35
36
37
38
# Use an official Node.js runtime as a parent image
FROM node:23-alpine AS build
# Set the working directory
WORKDIR /app/triangle-frontend
# Copy the package.json and package-lock.json files
COPY ./triangle-frontend/package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY ./triangle-frontend ./
# Build the Angular application
RUN npm run build
# Use a lightweight Node.js runtime to serve the SSR application
FROM node:23-alpine
# Set the working directory
WORKDIR /app/triangle-frontend
# Copy the built application from the previous stage
COPY --from=build /app/triangle-frontend/dist /app/triangle-frontend/dist
# Copy the package.json file from the first stage
COPY --from=build /app/triangle-frontend/package.json /app/triangle-frontend/package.json
# Install production dependencies (if needed for SSR)
# RUN npm install --production
# Expose the port the app runs on
EXPOSE 4000
# Command to run the SSR application
CMD ["npm", "run", "serve:ssr:triangle-frontend", "--", "--port", "4000"]