22 lines
827 B
Docker
22 lines
827 B
Docker
FROM postgres:16-alpine
|
|
|
|
# Copy backup file into the image
|
|
COPY backup_global_20260130_184353.sql /tmp/restore.sql
|
|
|
|
# Set correct permissions
|
|
RUN chmod 644 /tmp/restore.sql
|
|
|
|
# Create custom pg_hba.conf to allow connections from anywhere
|
|
RUN echo "# Allow connections from any IP address" > /tmp/pg_hba_additions.conf && \
|
|
echo "host all all 0.0.0.0/0 scram-sha-256" >> /tmp/pg_hba_additions.conf && \
|
|
echo "host all all ::/0 scram-sha-256" >> /tmp/pg_hba_additions.conf
|
|
|
|
# Copy script to append to pg_hba.conf on startup
|
|
COPY <<EOF /docker-entrypoint-initdb.d/00-allow-remote.sh
|
|
#!/bin/bash
|
|
echo "host all all 0.0.0.0/0 scram-sha-256" >> /var/lib/postgresql/data/pg_hba.conf
|
|
echo "host all all ::/0 scram-sha-256" >> /var/lib/postgresql/data/pg_hba.conf
|
|
EOF
|
|
|
|
RUN chmod +x /docker-entrypoint-initdb.d/00-allow-remote.sh
|