-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 811 Bytes
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 811 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
33
34
35
36
FROM node:14.17.0-alpine as builder
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install -f
# Copy the rest of the application code
COPY . .
# Build the application for production
RUN npm run build
# Create specific directory for jspdf-polyfill.js
RUN mkdir -p /app/dist/Slices/
# Use Nginx to serve the application
FROM nginx:alpine
# Copy custom nginx config to serve Angular properly
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
# Copy the built Angular app from the builder stage
COPY --from=builder /app/dist/Slices /usr/share/nginx/html/
# Copy jspdf-polyfill.js to nginx html directory
COPY ./src/jspdf-polyfill.js /usr/share/nginx/html/
# Expose port 4200
EXPOSE 4200
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]