-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.angular
39 lines (27 loc) · 1001 Bytes
/
Dockerfile.angular
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
# Use the specified Node.js version and platform
FROM --platform=$BUILDPLATFORM node:17.0.1 as builder
# Set the working directory
WORKDIR /project
# Install Angular CLI globally
RUN npm install -g @angular/cli@13
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install project dependencies
RUN npm ci
# Copy the entire project
COPY . .
# Build the Angular application
RUN ng build --configuration=production
# Stage for serving the Angular application
FROM nginx:alpine as final
# Copy the built Angular application to the NGINX directory
COPY --from=builder /project/dist/tik_tak_toe_front /usr/share/nginx/html
# Copy SSL certificate and key
COPY ssl/localhost.crt /etc/nginx/localhost.crt
COPY ssl/localhost.key /etc/nginx/localhost.key
# Configure NGINX to use SSL
COPY nginx-custom.conf /etc/nginx/conf.d/default.conf
# Expose port 443 for NGINX
EXPOSE 443
# Start NGINX to serve the Angular application with SSL
CMD ["nginx", "-g", "daemon off;"]