31 lines
1.2 KiB
Docker
31 lines
1.2 KiB
Docker
FROM python:3.11 as init
|
|
|
|
WORKDIR /root
|
|
ADD init-db-hba.py init-db-hba.py
|
|
RUN python3 init-db-hba.py \
|
|
"murmur/murmur" \
|
|
"mail/postfix" \
|
|
"mail/dovecot"
|
|
# Splits out init.sql and pg_hba.conf
|
|
|
|
FROM postgres:alpine
|
|
|
|
# FUCK YOU I PROVIDE MY OWN HBA EAT FUCKING SHIT
|
|
RUN --network=host apk add \
|
|
patch
|
|
ADD disable-hba-patcher.patch /tmp/disable-hba-patcher.patch
|
|
RUN patch -p0 /usr/local/bin/docker-entrypoint.sh /tmp/disable-hba-patcher.patch
|
|
|
|
# Certificates
|
|
COPY --from=redxen.eu/data/ca:latest /redxen.eu/certs/ca.crt /etc/redxen/postgres-cert/redxen.eu/certs/ca.crt
|
|
COPY --from=redxen.eu/data/postgres-cert:latest /redxen.eu/certs/postgres.crt /etc/redxen/postgres-cert/redxen.eu/certs/postgres.crt
|
|
COPY --from=redxen.eu/data/postgres-cert:latest /redxen.eu/keys/postgres.key /etc/redxen/postgres-cert/redxen.eu/keys/postgres.key
|
|
RUN chown -Rv postgres:postgres /etc/redxen/postgres-cert/
|
|
|
|
ADD postgresql.conf /etc/postgresql/postgresql.conf
|
|
COPY --from=init /root/pg_hba.conf /etc/postgresql/pg_hba.conf
|
|
COPY --from=init /root/init.sql /docker-entrypoint-initdb.d/init.sql
|
|
|
|
# TODO: https://hub.docker.com/_/postgres > Initialisation scripts (Database)
|
|
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
|