Files
netbox-stack/patroni.Containerfile
sven e7b53b6965 modified: .env
modified:   README.md
modified:   compose.yml
modified:   configuration.py
new file:   haproxy.cfg
new file:   init-patroni-users.sql
renamed:    entrypoint.sh -> netbox-entrypoint.sh
renamed:    Containerfile -> netbox.Containerfile
modified:   nginx.conf
new file:   patroni-entrypoint.sh
new file:   patroni.Containerfile
new file:   patroni.yml
2026-08-03 15:04:38 +02:00

35 lines
1.1 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# Patroni + PostgreSQL 16 – Alpine
# HA PostgreSQL cluster managed by Patroni
# DCS: etcd v3
# ============================================================
ARG POSTGRES_VERSION=16
FROM postgres:${POSTGRES_VERSION}-alpine
LABEL org.opencontainers.image.title="patroni-postgres" \
org.opencontainers.image.description="PostgreSQL 16 with Patroni HA (etcd DCS)"
# Patroni runtime: Python 3, pip, su-exec (privilege drop), curl (healthchecks)
RUN apk add --no-cache \
python3 \
py3-pip \
su-exec \
bash \
curl \
&& pip install --no-cache-dir --break-system-packages \
"patroni[etcd3,psycopg3]"
# Bake in base Patroni configuration
# Node-specific values overridden via PATRONI_* env vars at runtime
COPY patroni.yml /etc/patroni/patroni.yml
COPY patroni-entrypoint.sh /patroni-entrypoint.sh
RUN chmod +x /patroni-entrypoint.sh
# Patroni manages postgres lifecycle; data dir is a volume
VOLUME ["/var/lib/postgresql/data"]
ENTRYPOINT ["/patroni-entrypoint.sh"]
CMD ["patroni", "/etc/patroni/patroni.yml"]