I have a simple Flask app that I’d like to connect to my postgres db.
When I connect to my db via: fly postgres connect -a vtu-db
I successfully connect to psql and everything works.
When I fly ssh console --app vtu-db
and type psql
on the command line I get the following error:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?
When I try accessing postgres from my app using the DATABASE_URL
provided I get the same psql error as above.
I’ve tried a bunch of stuff but not really sure what is going on.
Here’s the contents of my .toml for reference:
primary_region = "sea"
[build]
builder = "paketobuildpacks/builder:base"
[env]
PORT = "8080"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 1024
Thanks for the help in advance!