Skip to content

Commit

Permalink
fix gis build
Browse files Browse the repository at this point in the history
  • Loading branch information
hors committed Nov 7, 2023
1 parent 6e1c2a4 commit 7651b78
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
33 changes: 33 additions & 0 deletions postgresql-containers/bin/postgres-gis/setup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SET application_name="container_setup";

create extension postgis;
create extension postgis_topology;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension pg_stat_statements;
create extension pgaudit;

alter user postgres password 'PG_ROOT_PASSWORD';

create user "PG_PRIMARY_USER" with REPLICATION PASSWORD 'PG_PRIMARY_PASSWORD';
create user "PG_USER" with password 'PG_PASSWORD';

create table primarytable (key varchar(20), value varchar(20));
grant all on primarytable to "PG_PRIMARY_USER";

create database "PG_DATABASE";

grant all privileges on database "PG_DATABASE" to "PG_USER";

\c "PG_DATABASE"

create extension postgis;
create extension postgis_topology;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension pg_stat_statements;
create extension pgaudit;

\c "PG_DATABASE" "PG_USER";

create schema "PG_USER";
26 changes: 23 additions & 3 deletions postgresql-containers/build/postgres-postgis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
arg basever
FROM percona/percona-postgresql-operator:${basever}-postgres
ARG PG_MAJOR=14
ARG PGO_TAG=main
ARG ORG_NAME=perconalab

FROM ${ORG_NAME}/percona-postgresql-operator:${PGO_TAG}-ppg${PG_MAJOR}

LABEL name="Percona PostgreSQL Distribution" \
vendor="Percona" \
summary="Percona Distribution for PostgreSQL" \
description="Percona Distribution for PostgreSQL is a collection of tools to assist you in managing your PostgreSQL database system" \
maintainer="Percona Development <[email protected]>"

USER 0

COPY build/postgres-postgis/oracle-linux-ol8.repo /etc/yum.repos.d/

RUN set -ex; \
curl -Lf -o /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8; \
microdnf -y install epel-release; \
microdnf -y module disable postgresql; \
microdnf -y install percona-postgis33 percona-postgis33-client;
microdnf -y --enablerepo="epel" install percona-postgis33 percona-postgis33-client

EXPOSE 5432

COPY bin/postgres-gis /opt/crunchy/bin/postgres

ENTRYPOINT ["/opt/crunchy/bin/uid_postgres.sh"]

USER 26

CMD ["/opt/crunchy/bin/start.sh"]

0 comments on commit 7651b78

Please sign in to comment.