Skip to content

Commit 4356a95

Browse files
committed
Add pm2 to make server production ready
1 parent 703830d commit 4356a95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Dockerfile.prod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ RUN git clone https://github.com/codeuino/social-platform-donut-backend.git
88

99
WORKDIR /server/social-platform-donut-backend
1010

11-
RUN npm install && npm cache clean --force --loglevel=error
11+
RUN npm install && \
12+
npm install pm2@latest -g && \
13+
npm cache clean --force --loglevel=error
1214

1315
# Start the server
14-
CMD [ "npm", "start" ]
16+
CMD [ "pm2", "start", "./bin/www", "--time", "--no-daemon" ]

0 commit comments

Comments
 (0)