Skip to content

Commit

Permalink
postgres v17
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 committed Jan 24, 2025
1 parent 5bf4f0f commit e477904
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Dockerfile-postgres
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
FROM sibedge/postgres-plv8-bigint:15.2-3.1.6-bookworm
FROM sibedge/postgres-plv8-bigint:17.1-3.2.3-bookworm

ENV POSTGRES_PASSWORD password
ENV POSTGRES_PASSWORD=password
ENV PGPASSWORD=password

USER root

RUN echo "deb http://ftp.de.debian.org/debian trixie main" >> /etc/apt/sources.list

RUN apt-get update && \
apt-get -y install postgresql-15-postgis-3 postgresql-plpython3-15 git python3-boto3 make
apt-get -y install postgresql-17-postgis-3 postgresql-plpython3-17 git python3-boto3 make

WORKDIR /home/1001
#Clone forked AWS RDS S3-Extension mock called "chimpler"
RUN git clone https://github.com/mchrza/postgres-aws-s3.git --branch v.1.0.9 .
RUN make install

ARG PGCONFFILE=/opt/bitnami/postgresql/conf/postgresql.conf

#Add mocked aws settings during initializiation phase
RUN echo "#!/bin/sh -e \n\
echo aws_s3.endpoint_url='http://localstack:4566' >> /var/lib/postgresql/data/postgresql.conf \n\
echo aws_s3.access_key_id='localstack' >> /var/lib/postgresql/data/postgresql.conf \n\
echo aws_s3.secret_access_key='localstack' >> /var/lib/postgresql/data/postgresql.conf \n\
RUN echo -e "#!/bin/sh -e \n\
echo aws_s3.endpoint_url='http://localstack:4566' >> $PGCONFFILE \n\
echo aws_s3.access_key_id='localstack' >> $PGCONFFILE \n\
echo aws_s3.secret_access_key='localstack' >> $PGCONFFILE \n\
psql -a -d postgres -U postgres -c \"SELECT pg_reload_conf();CREATE USER ro_user WITH SUPERUSER ENCRYPTED PASSWORD 'password';GRANT pg_read_all_data TO ro_user;GRANT pg_write_server_files TO ro_user;\" > /dev/null \n\
psql -a -d postgres -U postgres -c \"CREATE DATABASE postgres_db2;\" > /dev/null \n\
" > /docker-entrypoint-initdb.d/cfg_s3_dummy.sh

RUN chmod 755 /docker-entrypoint-initdb.d/cfg_s3_dummy.sh

#Increase Database Loglevel
RUN echo "#!/bin/sh -e\n\
RUN echo -e "#!/bin/sh -e\n\
\n\n\
sed -i.org \
-e \"s/#log_min_messages = warning/log_min_messages = info/\" \
-e \"s/#log_min_error_statement = error/log_min_error_statement = info/\" \
-e \"s/#log_statement = 'none'/log_statement = 'all'/\" \
/var/lib/postgresql/data/postgresql.conf\n\n\
$PGCONFFILE\n\n\
\n\n\
" > /docker-entrypoint-initdb.d/cfg_postgresql.conf.sh

Expand Down

0 comments on commit e477904

Please sign in to comment.