fix: Fix dockerfile and docker-compose for testing suite (#239)

- This was broken after the postgresql-partman update: https://github.com/dbsystel/postgresql-partman-container/pull/32
- Also needed to specify proper env variables

Co-authored-by: TAMARA LIPOWSKI <data.lipowski@extaccount.com>
This commit is contained in:
Tamara
2025-08-29 18:19:39 -04:00
committed by GitHub
parent 6fba0b3b3d
commit 354f61a360
2 changed files with 16 additions and 8 deletions

View File

@@ -6,12 +6,14 @@ services:
dockerfile: postgres.Dockerfile dockerfile: postgres.Dockerfile
restart: "always" restart: "always"
environment: environment:
POSTGRESQL_PASSWORD: mypassword POSTGRES_PASSWORD: mypassword
POSTGRESQL_DATABASE: tycho_indexer_0 POSTGRES_DATABASE: tycho_indexer_0
POSTGRESQL_USERNAME: postgres POSTGRES_USERNAME: postgres
POSTGRESQL_SHARED_PRELOAD_LIBRARIES: pg_cron POSTGRESQL_SHARED_PRELOAD_LIBRARIES: pg_cron
ports: ports:
- "5431:5432" - "5431:5432"
shm_size: "1gb" shm_size: "1gb"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes: volumes:
postgres_data: postgres_data:

View File

@@ -1,12 +1,13 @@
# This Dockerfile creates a custom postgres image used for CI and local deployment. # This Dockerfile creates a custom postgres image used for CI and local deployment.
# This is required because we use some postgres extensions that aren't in the generic # This is required because we use some postgres extensions that aren't in the generic
# Postgres image such as pg_partman or pg_cron. # Postgres image such as pg_partman or pg_cron.
# As an image with pg_partman already exist, we start from this one and add pg_cron # As an image with pg_partman already exist, we start from this one and add pg_cron
# and possibly other extensions on top of that. # and possibly other extensions on top of that.
FROM ghcr.io/dbsystel/postgresql-partman:15-5 FROM ghcr.io/dbsystel/postgresql-partman:15-5
ARG PGCRON_VERSION="1.6.2" ARG PGCRON_VERSION="1.6.2"
USER root USER root
RUN apk update && apk add --no-cache wget build-base clang19 llvm19
RUN cd /tmp \ RUN cd /tmp \
&& wget "https://github.com/citusdata/pg_cron/archive/refs/tags/v${PGCRON_VERSION}.tar.gz" \ && wget "https://github.com/citusdata/pg_cron/archive/refs/tags/v${PGCRON_VERSION}.tar.gz" \
&& tar zxf v${PGCRON_VERSION}.tar.gz \ && tar zxf v${PGCRON_VERSION}.tar.gz \
@@ -14,5 +15,10 @@ RUN cd /tmp \
&& make \ && make \
&& make install \ && make install \
&& cd .. && rm -r pg_cron-${PGCRON_VERSION} v${PGCRON_VERSION}.tar.gz && cd .. && rm -r pg_cron-${PGCRON_VERSION} v${PGCRON_VERSION}.tar.gz
RUN echo "cron.database_name = 'tycho_indexer_0'" >> /opt/bitnami/postgresql/conf/postgresql.conf
USER 1001 # Add configuration to postgresql.conf template
RUN echo "shared_preload_libraries = 'pg_partman_bgw,pg_cron'" >> /usr/local/share/postgresql/postgresql.conf.sample \
&& echo "cron.database_name = 'tycho_indexer_0'" >> /usr/local/share/postgresql/postgresql.conf.sample
# Stay as root user for PostgreSQL to work properly
# USER 1001