diff --git a/Dockerfile b/Dockerfile index c2be374..d6d58e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:13.8 +FROM postgres:13 RUN apt-get update RUN apt-get -y install postgresql-13-cron diff --git a/README.md b/README.md index 442f994..fc99cf2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Postgres givethio -We needed a postgres docker image with enabled pg_cron so we wrote and publish this docker image +We needed a postgres docker image with enabled pg_cron and pg_trgm so we wrote and publish this docker image to use it in https://github.com/Giveth/impact-graph related PR in impact-graph https://github.com/Giveth/impact-graph/pull/658 diff --git a/init-db/001-setup.sh b/init-db/001-setup-pg_cron.sh similarity index 77% rename from init-db/001-setup.sh rename to init-db/001-setup-pg_cron.sh index 92e840f..1b19da6 100755 --- a/init-db/001-setup.sh +++ b/init-db/001-setup-pg_cron.sh @@ -4,9 +4,8 @@ # Remove last line "shared_preload_libraries='citus'" sed -i '$ d' /var/lib/postgresql/data/pgdata/postgresql.conf cat <> /var/lib/postgresql/data/pgdata/postgresql.conf -shared_preload_libraries='pg_cron' -cron.database_name='givethio' +shared_preload_libraries = 'pg_cron,pg_trgm'; +cron.database_name = 'givethio' EOT # Required to load pg_cron pg_ctl restart - diff --git a/init-db/002-setup-pg_trgm.sql b/init-db/002-setup-pg_trgm.sql new file mode 100644 index 0000000..d497121 --- /dev/null +++ b/init-db/002-setup-pg_trgm.sql @@ -0,0 +1 @@ +CREATE EXTENSION pg_trgm;