feat: add docker-compose.yaml to set up postgres
This commit is contained in:
665
protocol-testing/Cargo.lock
generated
665
protocol-testing/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
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,11 @@ 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
|
||||||
|
# Start with postgres database, then switch to tycho_indexer_0 after it's created
|
||||||
|
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
|
||||||
@@ -17,8 +17,9 @@ RUN cd /tmp \
|
|||||||
&& cd .. && rm -r pg_cron-${PGCRON_VERSION} v${PGCRON_VERSION}.tar.gz
|
&& cd .. && rm -r pg_cron-${PGCRON_VERSION} v${PGCRON_VERSION}.tar.gz
|
||||||
|
|
||||||
# Add configuration to postgresql.conf template
|
# Add configuration to postgresql.conf template
|
||||||
|
# Start with postgres database, then switch to tycho_indexer_0 after it's created
|
||||||
RUN echo "shared_preload_libraries = 'pg_partman_bgw,pg_cron'" >> /usr/local/share/postgresql/postgresql.conf.sample \
|
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
|
&& echo "cron.database_name = 'tycho_indexer_0'" >> /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|
||||||
# Stay as root user for PostgreSQL to work properly
|
# Stay as root user for PostgreSQL to work properly
|
||||||
# USER 1001
|
# USER 1001
|
||||||
Reference in New Issue
Block a user