-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (30 loc) · 878 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
40
41
42
43
44
45
46
47
48
49
50
51
52
# FROM node:16-alpine AS build
# WORKDIR /app
# COPY package*.json .
# RUN npm install
# COPY . .
# EXPOSE 4200
# CMD ["npm", "start"]
# Using ngix because it is offers faster build time and it reduces the size of the app, offers improved scalability
# FROM node:16-alpine AS build
# WORKDIR /app
# COPY package*.json .
# RUN npm install
# RUN npm run build
# # Serve Application using Nginx Server
# FROM nginx:alpine
# COPY --from=build /dist/src/app/dist/takenote-angular /usr/share/nginx/html
# EXPOSE 80
FROM node:18-alpine3.17 AS builder
WORKDIR /usr/src/app
COPY package*.json .
RUN npm install
COPY . .
RUN npm run build --prod
# Server stage
FROM nginx:alpine
COPY --from=builder /usr/src/app/dist/takenote-ft/ /usr/share/nginx/html
EXPOSE 80
# TERMINAL
# docker build -t danielchukwu/takenote-ft .
# docker run -p 3000:80 danielchukwu/takenote-ft