Commit 9082d4a9 authored by Ignacio's avatar Ignacio
Browse files

Sobreescribe docker-entrypoint para cargar pg_cron

Es necesario añadir config en postgresql.conf para
poder instalar extensión en la db
parent abc6194c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
*
!scripts
 No newline at end of file
!rootfs
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ RUN apk add --no-cache --virtual .build-deps build-base ca-certificates openssl
	    && cd .. && rm -rf pg_partman.tgz && rm -rf pg_partman-* \
	    && echo "shared_preload_libraries='pg_partman_bgw,pg_cron'" >> /usr/local/share/postgresql/postgresql.conf.sample \
	    && echo "checkpoint_timeout = 30min" >> /usr/local/share/postgresql/postgresql.conf.sample \
	    && echo "max_wal_size = 2GB" >> /usr/local/share/postgresql/postgresql.conf.sample
	    && echo "max_wal_size = 2GB" >> /usr/local/share/postgresql/postgresql.conf.sample \
	    && mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint-origin.sh

COPY /scripts/ /docker-entrypoint-initdb.d/
 No newline at end of file
COPY rootfs /
+1 −0
Original line number Diff line number Diff line
PGDATA=/var/lib/postgresql/data/db-files/
DESIRED_WORKER_AZ=b
INTERVAL=daily
POSTGRES_DB=ais
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ services:
  postgresql:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    environment:
      - POSTGRES_DB
      - POSTGRES_PASSWORD
      - POSTGRES_USER
      - PGDATA
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
	CREATE SCHEMA IF NOT EXISTS ais;

	-- Install extensions
Loading