-
Install Heroku CLI (https://devcenter.heroku.com/articles/heroku-cli)
-
Login to Heroku CLI
-
Login to Heroku's container registry:
heroku container:login- If you face issues, try
docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
-
Create a new Heroku app and add Postgres DB add-on
-
Define your desired Prisma image
VERSIONand set theHEROKU_APPvarirables in a local.env -
Insert the ENV variables required in
prerun_hook.shin the config for your Heroku app. Define the following:PRISMA_MANAGEMENT_API_SECRETDB_HOSTDB_NAMEDB_USERDB_PASSWORDPRISMA_CONFIG_PATH(set this to/app/config.yml)JAVA_OPTS(set this to-Xmx358m)
NOTE: The
DB_*fields can be derived from theDATABASE_URLENV var set in Heroku when you add the Postgres DB. ie,postgres://<DB_USER>:<DB_PASSWORD>@<DB_HOST>:5432/<DB_NAME>Also, no need to set the
PORT, as it is dynamically defined by Heroku during deployment -
Run
yarn deploy
- Have the Heroku CLI installed
- Be logged in to an account that has access to the projects
- Run
yarn deploy - Profit
Change the version VERSION ENV var in .env and run yarn deploy again