PostgreSQL Docker Image
Find a file
2024-03-31 04:56:06 +02:00
.dockerignore docker should ignore bash history 2024-03-31 00:21:09 +01:00
.gitignore Updated to PostgreSQL 16 and added proper locale settings 2024-03-01 02:54:24 +01:00
.gitlab-ci.yml Adding README and switching CI to latest Docker and Dind 2024-03-31 00:09:33 +01:00
docker-entrypoint.sh First commit 2023-03-19 07:55:01 +01:00
Dockerfile Listen address * by parameter enforced 2024-03-31 00:44:36 +01:00
README.md Adding more README 2024-03-31 04:56:06 +02:00

PostgreSQL 16 Image

About

This is a special image that I created out of necessity to have a dynamic User ID and Group ID for the data of the PostgreSQL, while also solving the default listen address problem normally happening with Docker, without touching configuration. It will always listen to all network addresses. Additionally we use a Debian image and install the Debian packages for all the PostgreSQL modules from the official PostgreSQL Debian repository. This allows to activate them on demand. The image also contains a proper healthcheck that checks 4 times on the interval of 30 seconds with a timeout of 3 seconds. If you need this configurable, please contact me. The user will be called postgres and his home will be /var/lib/postgresql. The PostgreSQL itself is installed under /data.

How To Use

If you use the image, you will have to make a mount for the /data directory inside the image. Please be aware, that this directory must exist before and must have the same User ID and Group ID as the image is using, else Docker creates a root owned directory, the init db will fail. If you do not want the image to listen to all network addresses, then just set a new command.

Image Name

The image name to use the image in your Docker is docker.ci/srv/postgres:latest. This is only applicable, if you do not want to change the User ID and Group ID.

ARGS

For changing the ARGS, you need to copy the repository and build the image yourself with setting the necessary ARGS to get a new image. As convention, you could use the User ID as the tag name for your new image, we will not make an official tag that is just a number, so you will not collide here in the future. Of course, you can also just give it then a complete new image name, so that there can't be any collide.

SRV_UID

User ID for the PostgreSQL daemon and so of the data (Default: 1000)

SRV_GID

Group ID for the PostgreSQL daemon and so of the data (Default: 1000)

SRV_LOCALE

Locale used for initdb, it will be extended with .UTF-8 and set for locale, lc-ctype, lc-monetary, lc-numeric, lc-time and lc-collate. In addition encoding is set to UTF8. Please be aware that after the database is initialized, a changing of this parameter is not having any effect, the database will not change its settings, also new databases are not set with different parameters, as initdb is not used there anymore. (Default: en_US)

Support

Discord

Join the People, Postgres, Data Discord and highlight Getty for support.

IRC

Join the Libera.Chat IRC server and best message Getty for support, you can also join the #postgresql channel there, via irc://irc.libera.chat:+6697/postgresql.

Email

You can also email me under getty@conflict.industries