Skip to content

Commit

Permalink
➖ Remove forever.js from the Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
marwonline committed Oct 21, 2020
1 parent c0c8751 commit b35f942
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ WORKDIR /iframely
ENV NODE_ENV=production

RUN apk add --no-cache git && \
yarn add forever && \
yarn install --frozen-lockfile --production

ENTRYPOINT [ "/iframely/docker/entrypoint.sh" ]
28 changes: 2 additions & 26 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
#!/bin/ash
#!/bin/sh

export ARGV="$@"
export ARGC="$#"

function sigterm_handler() {
echo "SIGTERM signal received."
yarn forever stopall
}

trap "sigterm_handler; exit" TERM

function entrypoint() {
if [ "$ARGC" -eq 0 ]
then
# Run server in cluster mode by default
yarn forever start cluster.js
else
# Use command line arguments supplied at runtime
yarn forever start $ARGV
fi

yarn forever --fifo logs 0 &
wait
}

entrypoint
exec node cluster.js

0 comments on commit b35f942

Please sign in to comment.