Hey there! I’m currently trying to migrate my Nest.js backend from Heroku to Fly and I am running into issues with the setup, especially the database connection.
You can check this pull request to see where I’m currently at: https://github.com/herrherrmann/awesome-games-api/pull/8
I’ve set up a Fly app for the Node.js API and an app for the Postgres database and there’s a correct-looking
DATABASE_URL secret defined in my app. But when I try to deploy the API with
flyctl deploy, the database connection cannot be established:
2022-11-02T17:01:01.782 app fra [info] [Nest] 520 - 11/02/2022, 5:01:01 PM [ExceptionHandler] The server does not support SSL connections +2ms 2022-11-02T17:01:01.783 app fra [info] Error: The server does not support SSL connections
I suspect there’s something wrong with reading the
DATABASE_URL environment variable and/or the SSL setup, but I’m out of ideas right now about what can be adjusted there.
I also had to adjust the Dockerfile quite a bit to get that far (the auto-generated Dockerfile did not seem to be compatible with TypeScript and/or the required older Node version 10.15.3). I’m definitely not a Docker expert, so there might also be an issue with that one.
Can anyone give me a lead about what I can try next? That would be very much appreciated.