Deployment guide: Heroku #1364
Replies: 1 comment
-
From Josh on slack: PA couple things from memory though (Postgres centric). First, Heroku will expose attached databases via the Environment/Config Var DATABASE_URL (e.g. dbtype://user:pass@host:port/database which the TypeORM dbConnectionOptions can handle as the url property. (No surprise, but just confirmed this works). Second, Heroku+Postgres requires SSL connections. There is a query parameter you can apply to the DB URL for this to work (for PG), but I don't think you can modify DATABASE_URL and Heroku doesn't seem to use it. So you must set ssl: true in dbConnectionOptions. This is further complicated because TypeORM or more likely the underlying database driver / TLS/SSL library will complain about an untrusted self-signed certificate (from AWS/RDS?). Sledgehammer workaround to disable SSL verification in your run script / Procfile: NODE_TLS_REJECT_UNAUTHORIZED=0 npx typeorm migration:run but that shouldn't be done in production. |
Beta Was this translation helpful? Give feedback.
-
Collecting notes here about Heroku Deployment. The goal is to use our collective experience to create an official deployment guide.
Comment with any successful actions, gotchas etc.
Beta Was this translation helpful? Give feedback.
All reactions