setup.sh 600 B

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