docker-entrypoint.sh 694 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -e
  3. # Where there is no arguments supplied that means its trying to invoke the base
  4. # image, so we are not going to do anything on startup
  5. if [ $# -eq 0 ]; then
  6. echo "Finalizing Base"
  7. else
  8. echo "Starting .."
  9. if [ ! -d "/app/node_modules" ]; then
  10. # This is a proxy entrypoint to copy the node packages to the app directory
  11. echo "Node modules not found, copying source node modules"
  12. cp -r /usr/src/app/node_modules/. /app/node_modules/
  13. else
  14. echo "Node modules found, starting... if you want to install the node modules
  15. fresh from build you can delete the ./node_modules directory and run again"
  16. fi
  17. fi
  18. docker-entrypoint.sh $@