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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20
Date: 2024-12-01 21:12:50
Message-ID: d380acb9-a8b4-4869-935b-c2c0f17ed594@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-12-01 21:14:18 Re: Errors when restoring backup created by pg_dumpall
Previous Message Tom Lane 2024-12-01 21:09:35 Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20