Files
money/process-compose.yaml
2025-10-13 21:10:46 -04:00

52 lines
1.1 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:
db:
condition: process_healthy