mirror of
https://github.com/Snouzy/workout-cool.git
synced 2026-05-19 14:40:35 +00:00
0c9c4b7d2c
* 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
23 lines
600 B
Bash
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
|