Hello,
I managed to get a postgres docker image to run and be available as specified:
$ docker run --rm -P -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD="1234" --name pg postgis/postgis
...
...
...
2022-04-11 04:26:39.722 UTC [1] LOG: starting PostgreSQL 13.5 (Debian 13.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-04-11 04:26:39.723 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-04-11 04:26:39.723 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-04-11 04:26:39.726 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
How can I connect to this via the database.yml file?
This is the result I get now with the config that worked with a postgres server installed via Homebrew:
> rails db:create
connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
I’d really like to learn how to change database.yml for the postgres access change.
I am a noob. Any vocabulary suggestions are welcome too!
netstat info with and without names:
$ netstat -at -p TCP | grep LISTEN
tcp46 0 0 *.60266 *.* LISTEN
tcp4 0 0 *.60265 *.* LISTEN
tcp4 0 0 localhost.postgresql *.* LISTEN
tcp46 0 0 *.http *.* LISTEN
...
...
$ netstat -ant -p TCP | grep LISTEN
tcp46 0 0 *.60266 *.* LISTEN
tcp4 0 0 *.60265 *.* LISTEN
tcp4 0 0 127.0.0.1.5432 *.* LISTEN
tcp46 0 0 *.80 *.* LISTEN
...
...
Thanks!