setup.sh 642 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. echo "Running Prisma migrations..."
  3. npx prisma migrate deploy
  4. echo "Generating Prisma client..."
  5. npx prisma generate
  6. if [ "$NODE_ENV" != "production" ]; then
  7. echo "Non-production environment detected, importing sample data..."
  8. # Import exercises if CSV exists
  9. if [ -f "./data/sample-exercises.csv" ]; then
  10. npx tsx scripts/import-exercises-with-attributes.ts ./sample-data/exercises.csv
  11. else
  12. echo "No exercises sample data found, skipping import."
  13. fi
  14. else
  15. echo "Production environment, skipping sample data import."
  16. fi
  17. echo "Starting the app..."
  18. exec "$@" # runs the CMD from the Dockerfile