|
| 1 | +# This file is auto generated from it's template, |
| 2 | +# see citusdata/tools/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile. |
| 3 | +FROM postgres:14.7 |
| 4 | +ARG VERSION=10.2.8 |
| 5 | +ARG POSTGIS_VERSION=3 |
| 6 | +LABEL maintainer="Citus Data https://citusdata.com" \ |
| 7 | + org.label-schema.name="Citus" \ |
| 8 | + org.label-schema.description="Scalable PostgreSQL for multi-tenant and real-time workloads" \ |
| 9 | + org.label-schema.url="https://www.citusdata.com" \ |
| 10 | + org.label-schema.vcs-url="https://github.com/citusdata/citus" \ |
| 11 | + org.label-schema.vendor="Citus Data, Inc." \ |
| 12 | + org.label-schema.version=${VERSION} \ |
| 13 | + org.label-schema.schema-version="1.0" |
| 14 | + |
| 15 | +ENV CITUS_VERSION ${VERSION}.citus-1 |
| 16 | + |
| 17 | +# install Citus |
| 18 | +RUN apt-get update \ |
| 19 | + && apt-get install -y --no-install-recommends \ |
| 20 | + ca-certificates \ |
| 21 | + curl \ |
| 22 | + && curl -s https://install.citusdata.com/community/deb.sh | bash \ |
| 23 | + && apt-get install -y postgresql-$PG_MAJOR-citus-10.2=10.2.8.citus-1 \ |
| 24 | + postgresql-$PG_MAJOR-hll=2.17.citus-1 \ |
| 25 | + postgresql-$PG_MAJOR-topn=2.5.0.citus-1 \ |
| 26 | + postgresql-$PG_MAJOR-postgis-${POSTGIS_VERSION} \ |
| 27 | + && apt-get purge -y --auto-remove curl \ |
| 28 | + && rm -rf /var/lib/apt/lists/* |
| 29 | + |
| 30 | +# add citus to default PostgreSQL config |
| 31 | +RUN echo "shared_preload_libraries='citus'" >> /usr/share/postgresql/postgresql.conf.sample |
| 32 | + |
| 33 | +# add scripts to run after initdb |
| 34 | +COPY 001-create-citus-extension.sql /docker-entrypoint-initdb.d/ |
| 35 | +COPY 002-create-postgis-extension.sql /docker-entrypoint-initdb.d/ |
| 36 | + |
| 37 | +# add health check script |
| 38 | +COPY pg_healthcheck wait-for-manager.sh / |
| 39 | +RUN chmod +x /wait-for-manager.sh |
| 40 | + |
| 41 | +# entry point unsets PGPASSWORD, but we need it to connect to workers |
| 42 | +# https://github.com/docker-library/postgres/blob/33bccfcaddd0679f55ee1028c012d26cd196537d/12/docker-entrypoint.sh#L303 |
| 43 | +RUN sed "/unset PGPASSWORD/d" -i /usr/local/bin/docker-entrypoint.sh |
| 44 | + |
| 45 | +HEALTHCHECK --interval=4s --start-period=6s CMD ./pg_healthcheck |
0 commit comments