Sign inSign up

epicmorg/postgres-patroni

By epicmorg

•Updated about 2 hours ago

Patroni 4.1 (etcd) HA cluster node on top of epicmorg/postgres 9.3-18

Image
0

5.1K

epicmorg/postgres-patroni repository overview

⁠epicmorg/postgres-patroni

Patroni⁠ high-availability PostgreSQL node, one tag per PostgreSQL major, built on top of epicmorg/postgres:<major>⁠ (so the same PostgreSQL build and extension set).

⁠What's inside

  • everything from epicmorg/postgres:<major>;
  • patroni[psycopg2,etcd] 4.1.* installed with pip (DCS: etcd);
  • the entrypoint starts patroni /etc/patroni.yml as the postgres user, with PATRONI_LOG_DIR=/var/log/patroni and PATRONI_LOG_LEVEL=DEBUG;
  • /var/lib/postgresql owned by postgres (mode 0700) - mount the data directory there;
  • htop, net-tools for troubleshooting.

The image ships no patroni.yml: mount your own at /etc/patroni.yml (it defines the PostgreSQL port, data directory, REST API listen address, etcd hosts, users and replication).

⁠Tags

TagsDockerfile
9.39.3⁠
9.49.4⁠
9.59.5⁠
9.69.6⁠
1010⁠
1111⁠
1212⁠
1313⁠
1414⁠
1515⁠
1616⁠
1717⁠
18, latest18⁠

Every tag is pushed to docker.io, quay.io and ghcr.io (epicmorg/postgres-patroni:<tag> on each) - same digest everywhere.

⁠Usage

One node of a cluster (repeat per host with its own patroni.yml; an etcd cluster is required):

services:
  patroni17:
    image: epicmorg/postgres-patroni:17
    container_name: patroni17
    restart: always
    ports:
      - "6432:6432"   # PostgreSQL, as set in patroni.yml
      - "8008:8008"   # Patroni REST API, as set in patroni.yml
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - ./data/17:/var/lib/postgresql
      - ./config/patroni.yml:/etc/patroni.yml:ro
      - ./logs/patroni:/var/log/patroni
      - ./logs/postgresql:/var/log/postgresql
    environment:
      PATRONICTL_CONFIG_FILE: /etc/patroni.yml
    depends_on:
      - etcd

Users, passwords and initdb options come from patroni.yml (the POSTGRES_* variables of epicmorg/postgres are not used here). patronictl list inside the container shows the cluster state (PATRONICTL_CONFIG_FILE points it at the config). Configuration reference: Patroni YAML configuration⁠.

Tag summary

Content type

Image

Digest

sha256:0d364c7ba…

Size

1.8 GB

Last updated

about 2 hours ago

docker pull epicmorg/postgres-patroni