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
- Your server + database will be automatically configured and started. Each git push will trigger a new deploy
Without database:
Use this
render.yaml
:# render.yamlservices:- type: webname: myappenv: nodeplan: starterbuildCommand: yarn; blitz buildstartCommand: 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.yamlservices:- type: webname: myappenv: nodeplan: starterbuildCommand: yarn; blitz db migrate; blitz buildstartCommand: blitz start --production -H 0.0.0.0envVars:- key: DATABASE_URLfromDatabase:name: myapp-dbproperty: connectionStringdatabases:- name: myapp-dbplan: starter