59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
version: "0.5"
|
|
|
|
log_location: .logs
|
|
log_level: info
|
|
|
|
settings:
|
|
server:
|
|
port: 0
|
|
|
|
processes:
|
|
db:
|
|
command: |
|
|
export PGDATA="./.db"
|
|
|
|
# Initialize if needed
|
|
if [ ! -d "$PGDATA" ]; then
|
|
initdb --auth=trust --no-locale --encoding=UTF8 -U postgres
|
|
fi
|
|
|
|
# Start PostgreSQL in foreground
|
|
postgres -D "$PGDATA" -k /tmp -p 5432
|
|
readiness_probe:
|
|
exec:
|
|
command: "pg_isready -h localhost -p 5432 -U postgres"
|
|
initial_delay_seconds: 2
|
|
period_seconds: 1
|
|
|
|
expo:
|
|
command: "pnpm start"
|
|
environment:
|
|
- "DATABASE_URL=postgresql://postgres@localhost:5432/money"
|
|
|
|
api:
|
|
command: "pnpm run dev"
|
|
working_dir: ./api
|
|
|
|
migrate:
|
|
command: |
|
|
createdb -h localhost -p 5432 -U postgres money 2>/dev/null || true
|
|
|
|
psql -h localhost -p 5432 -U postgres -c "ALTER SYSTEM SET wal_level = 'logical';"
|
|
|
|
echo "Migration and seeding complete!"
|
|
depends_on:
|
|
db:
|
|
condition: process_healthy
|
|
zero:
|
|
command: npx zero-cache-dev -p shared/src/schema.ts
|
|
depends_on:
|
|
migrate:
|
|
condition: process_completed_successfully
|
|
|
|
studio:
|
|
command: npx drizzle-kit studio
|
|
working_dir: ./shared
|
|
depends_on:
|
|
db:
|
|
condition: process_healthy
|