darfdx
TTCTheo's Typesafe Cult
•Created by darfdx on 1/21/2025 in #questions
[SOLVED] New to Docker, can't connect from localhost to DB on container
I am running Docker on Windows via Docker Desktop. I am trying to follow a tutorial and one of the first steps is connecting to a Postgres DB on Docker with Drizzle, but my I can't connect to it and I get an error saying the DB doesn't exist.
I have this compose.yml file:
This script for testing the connection:
And this is my DB URL on env:
Error stack:
If I connect on my local psql terminal, I can't connect to the DB and get a similar error. If I open docker's bash, I can connect to it.
Am I doing something wrong?
21 replies