Files
Norris Oduro 0c9c4b7d2c feature: add workout_cool service to docker compose file (#49)
* add workout_cool service to docker compose file

* connect to postgres not localhost

* update docker file to ensure sample files can be added optionally

* copy sample exercise to image and update setup.sh script to import seed data based on env

* update readme with setup instructions for docker compose
2025-06-22 22:34:42 +02:00

23 lines
600 B
Bash

#!/bin/sh
echo "Running Prisma migrations..."
npx prisma migrate deploy
echo "Generating Prisma client..."
npx prisma generate
if [ "$SEED_SAMPLE_DATA" = "true" ]; then
echo "Seed sample data enabled, importing sample data..."
# Import exercises if CSV exists
if [ -f "./data/sample-exercises.csv" ]; then
npx tsx import-exercises-with-attributes.ts ./data/sample-exercises.csv
else
echo "No exercises sample data found, skipping import."
fi
else
echo "Skipping sample data import."
fi
echo "Starting the app..."
exec "$@" # runs the CMD from the Dockerfile