Skip to content

BehindTheMusicTree/bodzify-db-postgres

Repository files navigation

bodzify-db-postgres

A customized PostgreSQL Docker image based on PostgreSQL 16.4, configured to allow remote connections with SCRAM-SHA-256 authentication.

Table of Contents

Features

  • Based on official PostgreSQL 16.4 image
  • Pre-installed dependencies: gettext, postgresql-client, net-tools
  • Configured for remote connections with SCRAM-SHA-256 authentication
  • Automatic configuration reload

Prerequisites

  • Docker installed on your system

Building the Image

To build the Docker image, run the following command in the project directory:

docker build -t bodzify-db-postgres .

Running the Container

To run the PostgreSQL container, use:

docker run -d \
  --name my-postgres \
  -e POSTGRES_PASSWORD=mysecretpassword \
  -e POSTGRES_DB=mydatabase \
  -p 5432:5432 \
  bodzify-db-postgres

Environment Variables

The container supports standard PostgreSQL environment variables:

  • POSTGRES_PASSWORD: Sets the password for the default postgres user
  • POSTGRES_USER: Sets the username for the default user (defaults to postgres)
  • POSTGRES_DB: Sets the name of the default database

Ports

  • 5432: Default PostgreSQL port

Connecting to the Database

Once the container is running, you can connect to the database using any PostgreSQL client:

psql -h localhost -p 5432 -U postgres -d mydatabase

Configuration

The image includes custom configuration in setup_conf.sh that:

  • Adds a pg_hba.conf entry to allow remote connections from any IP with SCRAM-SHA-256 authentication
  • Reloads the PostgreSQL configuration

Files

  • Dockerfile: Docker image definition
  • install_dependencies.sh: Script to install additional dependencies
  • setup_conf.sh: Script to configure PostgreSQL for remote access

License

[Specify your license here]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published