To Render.com

Deploy to a Server on Render.com

  1. Add one of the render.yaml files shown below
  2. Push code to your github repo
  3. Log in to Render.com
  4. Click on the “YAML” menu item, then click the ”New from YAML“ button
  5. Connect your github account then select your blitz app repo
  6. Click approve
  7. Go to “Services”, click on your new Blitz service, click on ”Environment“
  8. Click “Add Environment Variable”, enter SESSION_SECRET_KEY as the name, then click on the ”generate“ button in the value field. Then click save.
  9. Your server + database will be automatically configured and started. Each git push will trigger a new deploy

Without database:

Use this

render.yaml:

services:  - type: web    name: blitzapp    env: node    plan: starter    buildCommand: yarn --frozen-lockfile --prod=false && blitz build    # If you have an out of memory error, change startCommand to "yarn next start"    startCommand: blitz start --production    envVars:      - key: NODE_ENV        value: production      - key: DATABASE_URL        fromDatabase:          name: blitzapp-db          property: connectionString    startCommand: blitz start --production -H 0.0.0.0

With Postgres database:

Update your

render.yaml to provide the DATABASE_URL environment variable to connect to your database:

services:  - type: web    name: blitzapp    env: node    plan: starter    buildCommand: yarn --frozen-lockfile --prod=false && blitz prisma migrate deploy --preview-feature && blitz build    # If you have an out of memory error, change startCommand to "yarn next start"    startCommand: blitz start --production    envVars:      - key: NODE_ENV        value: production      - key: DATABASE_URL        fromDatabase:          name: blitzapp-db          property: connectionStringdatabases:  - name: blitzapp-db    plan: starter