Skip to content

Instantly share code, notes, and snippets.

@ruyjfs
Created November 19, 2018 18:56
Show Gist options
  • Save ruyjfs/55b80fa8d3d3213bb90d79f7910e3316 to your computer and use it in GitHub Desktop.
Save ruyjfs/55b80fa8d3d3213bb90d79f7910e3316 to your computer and use it in GitHub Desktop.
Entrypoint Example for Docker
#!/bin/sh
set -e
echo "[ . ][0%] Container Build - Starting Entrypoint of Application"
# if [ -d "./node_modules" ]; then
# echo "[ * ][10%] node_modules found - Remove node_modules for run npm install..."
# rm -rf ./node_modules
# fi
# if [ -d "./dist" ]; then
# echo "[ ** ][20%] dist found - Remove dist for run npm install..."
# rm -rf ./dist
# fi
# if [ -s "./package-lock.json" ]; then
# echo "[ *** ][30%] package-lock.json found - Remove package-lock.json for run npm install..."
# rm -rf ./package-lock.json
# fi
echo "[ **** ][40%] Run yarn install..."
# yarn import
# yarn
yarn
# echo "[ ******** ][80%] Build for prod..."
# npm run build:docker
echo "[ ********** ][100%] Container Build - Ending Entrypoint of Application"
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment