Deploy to a Server on 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
Without database:
Use this
render.yaml
:services:- type: webname: blitzappenv: nodeplan: starterbuildCommand: yarn --frozen-lockfile --prod=false; blitz build# If you have an out of memory error, change startCommand to "yarn next start"startCommand: blitz start --productionenvVars:- key: NODE_ENVvalue: production- key: DATABASE_URLfromDatabase:name: blitzapp-dbproperty: connectionStringstartCommand: 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: webname: blitzappenv: nodeplan: starterbuildCommand: 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 --productionenvVars:- key: NODE_ENVvalue: production- key: DATABASE_URLfromDatabase:name: blitzapp-dbproperty: connectionStringdatabases:- name: blitzapp-dbplan: starter