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. Your server + database will be automatically configured and started. Each git push will trigger a new deploy

Without database:

Use this

render.yaml:

# render.yaml
services:
- type: web
name: myapp
env: node
plan: starter
buildCommand: yarn; blitz build
startCommand: blitz start --production -H 0.0.0.0

With postgres database:

You first need to change the defined datasource in

db/schema.prisma from SQLite to Postgres

-datasource sqlite {
- provider = "sqlite"
- url = "file:./db.sqlite"
-
+datasource postgresql {
+ provider = "postgresql"
+ url = env("DATABASE_URL")
+}

Lastly, use this

render.yaml:

# render.yaml
services:
- type: web
name: myapp
env: node
plan: starter
buildCommand: yarn; blitz db migrate; blitz build
startCommand: blitz start --production -H 0.0.0.0
envVars:
- key: DATABASE_URL
fromDatabase:
name: myapp-db
property: connectionString
databases:
- name: myapp-db
plan: starter
Idea for improving this page?Edit it on Github