Skip to content

fix: docker postgres locale #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker-compose-indexer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
DB_SECRET: ${DB_SECRET}
DB_USER: ${DB_USER}
DB_NAME: ${DB_NAME}
DB_PORT: ${DB_PORT}
NETWORK: ${NETWORK}
PGPASSWORD: postgres

Expand All @@ -79,7 +80,7 @@ services:
volumes:
- ${DB_PATH}:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME} -p ${DB_PORT} -h localhost"]
test: [ "CMD-SHELL", "PGPASSWORD=${DB_SECRET} pg_isready -U ${DB_USER} -d ${DB_NAME} -p ${DB_PORT} -h localhost"]
interval: 10s
timeout: 3s
retries: 10
Expand Down
4 changes: 4 additions & 0 deletions docker/dockerfiles/postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ RUN apt update && apt install -y \
git \
ca-certificates \
sudo \
locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8 \
&& apt clean

ENV PG_VERSION_TAG=REL_14_11
Expand Down
10 changes: 6 additions & 4 deletions docker/dockerfiles/postgres/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ configure_postgres() {
fi
done

echo "host all all 0.0.0.0/0 md5" \
>> $PG_DATA/pg_hba.conf
if ! grep -q "^host all all 0.0.0.0/0 md5\$" "$PG_DATA/pg_hba.conf"; then
echo "host all all 0.0.0.0/0 md5" >> "$PG_DATA/pg_hba.conf"
fi

echo "listen_addresses='*'" \
>> $PG_DATA/postgresql.conf
if ! grep -q "^listen_addresses *= *'\*'\$" "$PG_DATA/postgresql.conf"; then
echo "listen_addresses='*'" >> "$PG_DATA/postgresql.conf"
fi

echo "PostgreSQL configuration updated successfully!"
}
Expand Down