Browse Source

refactor: Install node modules if not found in dev containers

Owen Diffey 1 month ago
parent
commit
21afae3e63
2 changed files with 8 additions and 0 deletions
  1. 4 0
      backend/entrypoint.dev.sh
  2. 4 0
      frontend/entrypoint.dev.sh

+ 4 - 0
backend/entrypoint.dev.sh

@@ -2,6 +2,10 @@
 
 set -e
 
+if [[ ! -d node_modules ]]; then
+    npm install
+fi
+
 if [ "${BACKEND_DEBUG}" = "true" ]; then
     export INSPECT_BRK="--inspect-brk=0.0.0.0:${BACKEND_DEBUG_PORT:-9229}"
 else

+ 4 - 0
frontend/entrypoint.dev.sh

@@ -2,6 +2,10 @@
 
 set -e
 
+if [[ ! -d node_modules ]]; then
+    npm install
+fi
+
 if [ "${APP_ENV}" = "development" ]; then
     ln -sf /opt/app/nginx.dev.conf /etc/nginx/http.d/default.conf
     nginx