Files
money/process-compose.yaml
2025-12-26 13:53:42 -05:00

68 lines
1.6 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
tailscale_machine_name:
command: "bun tsx ./scripts/set-machine-name.ts"
expo:
command: "bun --filter=@money/expo start"
depends_on:
tailscale_machine_name:
condition: process_completed_successfully
api:
command: "bun --filter=@money/api dev"
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';" \
-c "ALTER SYSTEM SET timezone = 'UTC'" \
-c "SELECT pg_reload_conf();"
echo "Migration and seeding complete!"
depends_on:
db:
condition: process_healthy
zero:
command: bunx zero-cache-dev -p packages/shared/src/schema.ts
depends_on:
migrate:
condition: process_completed_successfully
studio:
command: bunx drizzle-kit studio
working_dir: ./packages/shared
depends_on:
db:
condition: process_healthy
tunnel:
command: cloudflared tunnel --config ~/.cloudflared/config.yml run