Skip to content

Commit 59ef6e5

Browse files
committed
Deployment testing. Need to commit for zipping
1 parent 8ffd6e4 commit 59ef6e5

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Dockerfile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ FROM node:19-alpine as build
33

44
# python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
55
RUN apk add --no-cache --virtual .gyp \
6-
python3 \
7-
make \
8-
g++
6+
python3 \
7+
make \
8+
g++
99

1010
WORKDIR /app
1111

@@ -15,8 +15,8 @@ RUN npm install --no-install-recommends
1515

1616
COPY . .
1717

18-
# Stage 2: Node Server
19-
FROM node:19-alpine as node_server
18+
# Stage 2: Runtime
19+
FROM node:19-alpine as runtime
2020

2121
WORKDIR /app
2222

@@ -27,22 +27,10 @@ RUN npm install --no-install-recommends --only=production
2727
COPY --from=build /app/.env .env
2828
COPY --from=build /app/config.js ./config.js
2929
COPY --from=build /app/server ./server
30+
COPY --from=build /app/app/dist /app
3031

3132
EXPOSE 5656
3233

3334
ENV IS_DOCKER true
3435

3536
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;"]

Dockerfile-2stage renamed to Dockerfile-nginx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN npm install --no-install-recommends
1515

1616
COPY . .
1717

18-
# Stage 2: Runtime
19-
FROM node:19-alpine as runtime
18+
# Stage 2: Node Server
19+
FROM node:19-alpine as node_server
2020

2121
WORKDIR /app
2222

@@ -27,10 +27,22 @@ RUN npm install --no-install-recommends --only=production
2727
COPY --from=build /app/.env .env
2828
COPY --from=build /app/config.js ./config.js
2929
COPY --from=build /app/server ./server
30-
COPY --from=build /app/app/dist /app
3130

3231
EXPOSE 5656
3332

3433
ENV IS_DOCKER true
3534

3635
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;"]

0 commit comments

Comments
 (0)