Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20 - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20
Date
Msg-id d380acb9-a8b4-4869-935b-c2c0f17ed594@aklaver.com
Whole thread Raw
In response to Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
On 12/1/24 11:34, Alexander Farber wrote:
> Good evening,
> 
> I am trying to create a Dockerfile for development purposes, which
> would run Jetty and PostgreSQL. The PostgreSQL related part is below:
> 

> When I connect to the docker container via terminal,
> I am able to connect with "psql words_de" command.

The terminal is in the container host?

If so does the host have an instance of Postgres running on it?

> 
> But the "psql -h localhost words_de" command fails:


> Best regards
> Alex
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20
Next
From: Tom Lane
Date:
Subject: Re: Errors when restoring backup created by pg_dumpall