File tree Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ FROM node:19-alpine as build
3
3
4
4
# python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
5
5
RUN apk add --no-cache --virtual .gyp \
6
- python3 \
7
- make \
8
- g++
6
+ python3 \
7
+ make \
8
+ g++
9
9
10
10
WORKDIR /app
11
11
@@ -15,8 +15,8 @@ RUN npm install --no-install-recommends
15
15
16
16
COPY . .
17
17
18
- # Stage 2: Node Server
19
- FROM node:19-alpine as node_server
18
+ # Stage 2: Runtime
19
+ FROM node:19-alpine as runtime
20
20
21
21
WORKDIR /app
22
22
@@ -27,22 +27,10 @@ RUN npm install --no-install-recommends --only=production
27
27
COPY --from=build /app/.env .env
28
28
COPY --from=build /app/config.js ./config.js
29
29
COPY --from=build /app/server ./server
30
+ COPY --from=build /app/app/dist /app
30
31
31
32
EXPOSE 5656
32
33
33
34
ENV IS_DOCKER true
34
35
35
36
CMD [ "npm" , "start" ]
36
-
37
- # Stage 3: Nginx Server
38
- FROM nginx:alpine as nginx_server
39
-
40
- # Copy the build output to the Nginx html directory
41
- COPY --from=build /app/app/dist /usr/share/nginx/html
42
-
43
- # Copy the Nginx configuration file
44
- COPY nginx.conf /etc/nginx/conf.d/default.conf
45
-
46
- EXPOSE 80
47
-
48
- CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ RUN npm install --no-install-recommends
15
15
16
16
COPY . .
17
17
18
- # Stage 2: Runtime
19
- FROM node:19-alpine as runtime
18
+ # Stage 2: Node Server
19
+ FROM node:19-alpine as node_server
20
20
21
21
WORKDIR /app
22
22
@@ -27,10 +27,22 @@ RUN npm install --no-install-recommends --only=production
27
27
COPY --from=build /app/.env .env
28
28
COPY --from=build /app/config.js ./config.js
29
29
COPY --from=build /app/server ./server
30
- COPY --from=build /app/app/dist /app
31
30
32
31
EXPOSE 5656
33
32
34
33
ENV IS_DOCKER true
35
34
36
35
CMD [ "npm", "start" ]
36
+
37
+ # Stage 3: Nginx Server
38
+ FROM nginx:alpine as nginx_server
39
+
40
+ # Copy the build output to the Nginx html directory
41
+ COPY --from=build /app/app/dist /usr/share/nginx/html
42
+
43
+ # Copy the Nginx configuration file
44
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
45
+
46
+ EXPOSE 80
47
+
48
+ CMD ["nginx", "-g", "daemon off;"]
You can’t perform that action at this time.
0 commit comments