services: db: image: postgres:16-alpine environment: POSTGRES_USER: toolso POSTGRES_PASSWORD: toolso POSTGRES_DB: toolso ports: - "5432:5432" volumes: - db-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U toolso"] interval: 5s timeout: 5s retries: 10 app: build: . ports: - "3000:3000" environment: DATABASE_URL: postgresql://toolso:toolso@db:5432/toolso BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:-please-change-me-to-a-random-32-char-secret} BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost:3000} NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000} RESEND_API_KEY: ${RESEND_API_KEY:-} RESEND_FROM_EMAIL: ${RESEND_FROM_EMAIL:-} depends_on: db: condition: service_healthy volumes: db-data: # 首次启动后初始化数据库(在宿主机执行): # DATABASE_URL=postgresql://toolso:toolso@localhost:5432/toolso pnpm db:push # DATABASE_URL=postgresql://toolso:toolso@localhost:5432/toolso pnpm seed:tools # DATABASE_URL=postgresql://toolso:toolso@localhost:5432/toolso pnpm admin:setup