# Self-hosted stack: app + Postgres + one-shot schema push. # cp .env.example .env # fill in AUTH_SECRET etc. # docker compose up -d --build services: app: build: . restart: unless-stopped ports: - "${APP_PORT:-3000}:3000" environment: DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-crescio} AUTH_SECRET: ${AUTH_SECRET:?set AUTH_SECRET in .env (32+ random chars)} APP_URL: ${APP_URL:-http://localhost:3000} CRON_SECRET: ${CRON_SECRET:-} COOKIE_SECURE: ${COOKIE_SECURE:-false} SNAPTRADE_DEBUG_RAW: ${SNAPTRADE_DEBUG_RAW:-} CCXT_DEBUG_RAW: ${CCXT_DEBUG_RAW:-} COINGECKO_API_KEY: ${COINGECKO_API_KEY:-} volumes: - uploads:/app/public/uploads depends_on: db: condition: service_healthy migrate: condition: service_completed_successfully db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} POSTGRES_DB: ${POSTGRES_DB:-crescio} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 10 # One-shot: pushes the Prisma schema, then exits 0. migrate: build: context: . target: deps command: npx prisma db push --skip-generate environment: DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-crescio} depends_on: db: condition: service_healthy volumes: pgdata: uploads: