Rename folder for clarity
This commit is contained in:
24
examples/devcontainers/backend/entrypoint.sh
Executable file
24
examples/devcontainers/backend/entrypoint.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /app/backend
|
||||
cp .env.example .env
|
||||
echo "starting up..."
|
||||
node ace generate:key
|
||||
|
||||
# Check for pending migrations by parsing output
|
||||
PENDING_MIGRATIONS=$(node ace migration:status | grep -ic 'pending')
|
||||
|
||||
# Run migrations only if there are pending ones
|
||||
|
||||
if [ "$PENDING_MIGRATIONS" -gt 0 ]; then
|
||||
echo "Found $PENDING_MIGRATIONS pending migration(s). Running migrations..."
|
||||
node ace migration:run --force
|
||||
else
|
||||
echo "No pending migrations."
|
||||
fi
|
||||
|
||||
echo "Seeding database..."
|
||||
node ace db:seed
|
||||
|
||||
# Start the dev server
|
||||
node ace serve --watch
|
Reference in New Issue
Block a user