-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (26 loc) · 954 Bytes
/
Dockerfile
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
39
# Stage 1: Compile and Build angular codebase
# Use official node image as the base image
FROM node:latest as build
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY archigator/package*.json ./
# Install the Angular CLI
RUN npm install -g @angular/cli
# Install project dependencies
RUN npm install
# Copy the entire project to the working directory
COPY archigator .
# Build the Angular app
RUN ng build --configuration=production
# Use the Nginx image as the base for the final image
FROM nginx:latest
# Copy the Nginx configuration file to the container
COPY archigator/default.conf /etc/nginx/conf.d/default.conf
# Copy the built Angular app to Nginx's default public directory
COPY --from=build /app/dist/archigator /usr/share/nginx/html
COPY /images /usr/share/nginx/images/
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]