I’m really new to this and looking for a bit of guidance.
I’ve built a Vapor app with a Postgres Database and using Docker Compose to create an image running separate apps for the code and the database. This works as expected on my local machine.
However when running flyctl launch
I am seeing error in the logs stating the app cannot connect to the database. Has anyone encountered a similar problem before?
This is the error from the logs:
2024-06-25T16:52:43.698 app[3d8d172aeed3e8] scl [info] 2024-06-25T16:52:43+0000 error codes.vapor.application : database-id=psql [AsyncKit] Opening new connection for pool failed: PSQLError(code: connectionError, underlying: NIOPosix.NIOConnectionError(host: "localhost", port: 5432, dnsAError: nil, dnsAAAAError: nil, connectionErrors: [NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111))]))