-
Notifications
You must be signed in to change notification settings - Fork 101
/
Dockerfile
42 lines (35 loc) · 1.78 KB
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This file is auto generated from it's template,
# see citusdata/tools/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile.
FROM postgres:16.3
ARG VERSION=12.1.5
LABEL maintainer="Citus Data https://citusdata.com" \
org.label-schema.name="Citus" \
org.label-schema.description="Scalable PostgreSQL for multi-tenant and real-time workloads" \
org.label-schema.url="https://www.citusdata.com" \
org.label-schema.vcs-url="https://github.com/citusdata/citus" \
org.label-schema.vendor="Citus Data, Inc." \
org.label-schema.version=${VERSION} \
org.label-schema.schema-version="1.0"
ENV CITUS_VERSION ${VERSION}.citus-1
# install Citus
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
&& curl -s https://install.citusdata.com/community/deb.sh | bash \
&& apt-get install -y postgresql-$PG_MAJOR-citus-12.1=$CITUS_VERSION \
postgresql-$PG_MAJOR-hll=2.18.citus-1 \
postgresql-$PG_MAJOR-topn=2.6.0.citus-1 \
&& apt-get purge -y --auto-remove curl \
&& rm -rf /var/lib/apt/lists/*
# add citus to default PostgreSQL config
RUN echo "shared_preload_libraries='citus'" >> /usr/share/postgresql/postgresql.conf.sample
# add scripts to run after initdb
COPY 001-create-citus-extension.sql /docker-entrypoint-initdb.d/
# add health check script
COPY pg_healthcheck wait-for-manager.sh /
RUN chmod +x /wait-for-manager.sh
# entry point unsets PGPASSWORD, but we need it to connect to workers
# https://github.com/docker-library/postgres/blob/33bccfcaddd0679f55ee1028c012d26cd196537d/12/docker-entrypoint.sh#L303
RUN sed "/unset PGPASSWORD/d" -i /usr/local/bin/docker-entrypoint.sh
HEALTHCHECK --interval=4s --start-period=6s CMD ./pg_healthcheck