Skip to content

Postgres 16

A default Postgres install that is not really editable.

egg-postgres-16.json

updated

Ports

Add an allocation on the node for each port.

  • Server 5432

Install

Installer image
postgres:16-alpine
Install script
15 lines

Image

  • PostgreSQL 16 ghcr.io/ptero-eggs/yolks:postgres_16

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

2 variables

Startup command

postgres  -D /home/container/postgres_db/ & wait-port;  psql -h127.0.0.1 -p5432 --dbname postgres

Dotted values come from the server settings. These values are examples.

  • The username for the postgres superuser

    PGUSERUsers can see

    required|string|max:20

  • The postgres super user password with a strong default. You should be generating new ones for each server. If you don't then users can hit other users DB's

    PGPASSWORDUsers can see

    required|string|max:20

Wings

Stop command
\q
Running when the console shows
database system is ready to accept connections

Files Wings edits

Wings sets these values in these files before each start.

postgres_db/postgresql.conf file

#port =
port = {{server.build.default.port}}
#external_pid_file =
external_pid_file = '/home/container/postgres_db/run/postgres.pid'
#unix_socket_directories =
unix_socket_directories = '/home/container/postgres_db/run/'

Readme

PostgreSQL

From their Website

The World's Most Advanced Open Source Relational Database

Minimum RAM warning

2 Gigabytes minimum recommended

See here https://www.commandprompt.com/blog/postgresql_mininum_requirements/

Server Ports

Ports required to run the server in a table format.

Port default
Server 5432

Changes

  1. Fix postgres and add 13, 15, and 17

    · Daniel Barton · 1bf83a1

  2. Add database eggs

    · Daniel Barton · da2fc87

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 15 lines bash in postgres:16-alpine Show
#! /bin/ash
adduser -D -h /home/container container

chown -R container: /mnt/server/

su container -c 'initdb -D /mnt/server/postgres_db/ -A md5 -U "$PGUSER" --pwfile=<(echo "$PGPASSWORD")'

mkdir -p /mnt/server/postgres_db/run/

## Add default "allow from all" auth rule to pg_hba
if ! grep -q "# Custom rules" "/mnt/server/postgres_db/pg_hba.conf"; then
    echo -e "# Custom rules\nhost    all             all             0.0.0.0/0               md5" >> "/mnt/server/postgres_db/pg_hba.conf"
fi

echo -e "Done"