d70ee83a63
Configure Docker Compose, Dockerfiles for API and web servers, and a startup script to enable local development and deployment of the application. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 9b39e228-74f1-466d-ab5c-87a1e5e7ed07 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/kI0sxlu Replit-Helium-Checkpoint-Created: true
28 lines
769 B
Bash
Executable File
28 lines
769 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "[migrate] waiting for postgres at $DATABASE_URL ..."
|
|
for i in {1..60}; do
|
|
if node -e "
|
|
import('pg').then(({ default: pg }) => {
|
|
const c = new pg.Client({ connectionString: process.env.DATABASE_URL });
|
|
c.connect().then(() => c.end()).then(() => process.exit(0)).catch(() => process.exit(1));
|
|
});
|
|
" 2>/dev/null; then
|
|
echo "[migrate] postgres is ready."
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
echo "[migrate] pushing schema with drizzle-kit ..."
|
|
cd /app
|
|
pnpm --filter @workspace/db run push-force
|
|
|
|
echo "[migrate] seeding database ..."
|
|
pnpm --filter @workspace/scripts run seed || {
|
|
echo "[migrate] seed reported a non-zero exit (often safe if data already exists). Continuing."
|
|
}
|
|
|
|
echo "[migrate] done."
|