-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (23 loc) · 977 Bytes
/
Dockerfile
File metadata and controls
27 lines (23 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ARG VERSION=17-bookworm
# Use the base image
FROM postgres:${VERSION}
ARG VERSION
LABEL org.opencontainers.image.description="PostgreSQL image with primary/replica support" \
org.opencontainers.image.version="$VERSION"
# Install packages postgis and pgvector
ENV POSTGIS_MAJOR=3
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
ca-certificates \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
postgresql-$PG_MAJOR-pgvector \
&& rm -rf /var/lib/apt/lists/*
# Copy scripts
RUN mkdir -p /docker-entrypoint-initdb.d
COPY --chmod=755 ./scripts/10_primary.sh /docker-entrypoint-initdb.d
COPY --chmod=755 ./scripts/20_replica.sh /docker-entrypoint-initdb.d
COPY --chmod=755 ./scripts/30_ssl.sh /docker-entrypoint-initdb.d
COPY --chmod=755 ./scripts/40_databases.sh /docker-entrypoint-initdb.d
# Set the environment
ENV POSTGRES_REPLICATION_USER=replicator \
POSTGRES_REPLICATION_SLOT=replica1