← Files RenderARCHIVED FILE

skills/render-deploy/assets/nextjs-postgres.yaml

1.03 KB · Dec 5, 2026 · 00:24 UTC

↓ Download file

# Next.js Application with PostgreSQL
# Full-stack Next.js app with database

services:
  - type: web
    name: nextjs-app
    runtime: node
    plan: free
    region: oregon
    branch: main
    autoDeployTrigger: commit
    buildCommand: npm ci && npm run build
    # NextAuth.js v4 needs its canonical URL. Use Render's injected hostname by default;
    # set NEXTAUTH_URL explicitly if the application should use a custom domain instead.
    startCommand: NEXTAUTH_URL="${NEXTAUTH_URL:-https://$RENDER_EXTERNAL_HOSTNAME}" npm start
    healthCheckPath: /api/health
    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        fromDatabase:
          name: postgres
          property: connectionString
      - key: NEXTAUTH_SECRET
        sync: false  # User provides in Dashboard
      - key: JWT_SECRET
        generateValue: true

databases:
  - name: postgres
    databaseName: nextjs_production
    user: nextjs_user
    plan: free
    postgresMajorVersion: "15"
    ipAllowList: []  # Internal access only

SHA-256: b336d10794162a6d5d53e7ad291b0243e4fb62251d47fe9a030e6e0382a8a2d0