31 lines
876 B
Docker
31 lines
876 B
Docker
FROM postgres:15
|
|
|
|
|
|
RUN mkdir -p "$PGDATA" && \
|
|
chmod 00700 "$PGDATA" && \
|
|
mkdir -p /var/run/postgresql && \
|
|
chmod 03755 /var/run/postgresql
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
postgresql-15-pgpool2 \
|
|
&& \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
openssh-server \
|
|
sudo \
|
|
&& \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
echo "postgres ALL = (ALL) NOPASSWD:ALL" >> /etc/sudoers && \
|
|
echo "X11Forwarding no" >> /etc/ssh/sshd_config && \
|
|
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
|
|
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
|
|
|
|
COPY --chown=postgres:postgres postgres /var/lib/postgresql/
|
|
|
|
COPY --chmod=755 entrypoint.sh /usr/local/bin/
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|