Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
fix(entrypoint): stop handling
Browse files Browse the repository at this point in the history
Fix improper Docker stop handling
  • Loading branch information
lucaperret authored Mar 5, 2018
2 parents ce4e800 + b0b96ad commit 7fb72fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUN chmod +x ./strapi.sh

EXPOSE 1337

CMD ./strapi.sh
CMD ["./strapi.sh"]
13 changes: 12 additions & 1 deletion strapi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh
set -ea

_stopStrapi() {
echo "Stopping strapi"
kill -SIGINT "$strapiPID"
wait "$strapiPID"
}

trap _stopStrapi SIGTERM SIGINT

cd /usr/src/api

APP_NAME=${APP_NAME:-strapi-app}
Expand All @@ -15,4 +23,7 @@ then
fi

cd $APP_NAME
strapi start
strapi start &

strapiPID=$!
wait "$strapiPID"

0 comments on commit 7fb72fc

Please sign in to comment.