public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Farber <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20
Date: Sun, 1 Dec 2024 22:25:54 +0100
Message-ID: <CAADeyWg4YwL=EH+ctP5r1frWBv+pEMwx8JwQdK+_VjLz=H9iOw@mail.gmail.com> (raw)
In-Reply-To: <CAP8Hi7K4_62WCo4W852je7p8Vv+v2-dduJxSJCvtg27j1=jtvA@mail.gmail.com>
References: <CAADeyWiW+Uz5z_RJrB=dhWoZAOngQ2dHQt+2UOGJiEv6pbcDCA@mail.gmail.com>
	<[email protected]>
	<CAADeyWiWpQmcBPKtpSrmh0ZkyE3tpX-JTSr2UcBX-gO53ZM4TQ@mail.gmail.com>
	<CAADeyWhF5nXZY-7HHvGUxJ-fgq7rKgCYKcGrE6X_OuX+g3xb_Q@mail.gmail.com>
	<CAADeyWjY=6eOGxW4V_vVS8d1jm+Lz-GPYs3ViogWZfujoWws6A@mail.gmail.com>
	<CAP8Hi7K4_62WCo4W852je7p8Vv+v2-dduJxSJCvtg27j1=jtvA@mail.gmail.com>

Yes thank you, I have tried specifying the port at the CLI too... that did
not help.

But restarting PostgreSQL in my
custom /docker-entrypoint-initdb.d/run-after-initdb.sh
has helped, even though I am not sure if it is the best way:

#!/bin/sh

LANGUAGES="de en fr nl pl ru"

createuser --username=postgres words

psql --username=postgres -c "GRANT USAGE ON SCHEMA public TO words;"
psql --username=postgres -c "ALTER USER words PASSWORD 'mypassword';"

for L in $LANGUAGES; do
    createdb --username=postgres --owner=words words_$L
    cd /dict/$L && psql words_$L < words_$L.sql
done

# Restart PostgreSQL to make it listen at localhost too
pg_ctl --options "-c listen_addresses='localhost'" --wait restart


view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20
  In-Reply-To: <CAADeyWg4YwL=EH+ctP5r1frWBv+pEMwx8JwQdK+_VjLz=H9iOw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox