title | sidebar_label |
---|---|
Deploy to a Server on Render.com |
To Render.com |
- Add one of the
render.yaml
files shown below - Push code to your github repo
- Log in to Render.com
- Click on the "YAML" menu item, then click the "New from YAML" button
- Connect your github account then select your blitz app repo
- Click approve
- Go to "Services", click on your new Blitz service, click on "Environment"
- Click "Add Environment Variable", enter
SESSION_SECRET_KEY
as the name, then click on the "generate" button in the value field. Then click save. - Your server + database will be automatically configured and started. Each git push will trigger a new deploy
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
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 db migrate; 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
databases:
- name: blitzapp-db
plan: starter