Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 2d31149

Browse files
committed
Set pm2 as default command in docker build
.. and overwrite in docker-compose. Move layer COPY as far as possible to the end for faster rebuild.
1 parent 1ee9234 commit 2d31149

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
FROM node:8.9-alpine
22
LABEL Description="This image is used to start the hc-api-feathers" Vendor="Human-Connection gGmbH" Version="1.0" Maintainer="Human-Connection gGmbH ([email protected])"
33

4+
# expose the app port
5+
EXPOSE 3030
6+
# chrome debugging
7+
EXPOSE 9229
8+
49
# update unix packages
510
RUN apk update && apk upgrade
611
RUN rm -rf /var/cache/apk/*
@@ -17,10 +22,10 @@ RUN yarn install --frozen-lockfile --non-interactive
1722

1823
# copy the code to the docker image
1924
COPY . /API
20-
2125
# setup local configuration
2226
COPY ./config/docker/* /API/config/
2327

24-
# expose the app port
25-
EXPOSE 3030
26-
EXPOSE 9229
28+
# start the application in a autohealing cluster
29+
# NOTE: quick fix for server issues, restart api when reaching max of 300 MB Memory Usage (happens in conjunction with 100% CPU Usage)
30+
# TODO: find better way of dealing with that issue
31+
CMD ["pm2", "start", "server/index.js", "-n", "api", "--attach", "--max-memory-restart", "1024M"]

0 commit comments

Comments
 (0)