Created
September 9, 2020 10:43
-
-
Save gemmadlou/7c76627ab4068bf1e23e0e09af005407 to your computer and use it in GitHub Desktop.
My docker entrypoint example (Node)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# https://medium.com/swlh/five-use-cases-for-docker-entry-points-a5eb6661dac6 | |
case $1 in | |
server) | |
if [ "$ENVIRONMENT" == "production" ]; then | |
node /app/server.js | |
else | |
npx pm2-dev /app/server.js | |
fi | |
;; | |
test) | |
yarn test:ci | |
;; | |
*) | |
exec "$@" | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment