Skip to content

Instantly share code, notes, and snippets.

@robertbakker
Last active July 31, 2022 08:40
Show Gist options
  • Select an option

  • Save robertbakker/8bbb5f854fc90f93be5c2e6f5cd97878 to your computer and use it in GitHub Desktop.

Select an option

Save robertbakker/8bbb5f854fc90f93be5c2e6f5cd97878 to your computer and use it in GitHub Desktop.
Docker PostGis With Citus Extension
CREATE EXTENSION IF NOT EXISTS citus;
#https://github.com/citusdata/docker/blob/v10.2.5/001-create-citus-extension.sql
FROM postgis/postgis:13-3.1
ARG VERSION=10.2.5
ENV CITUS_VERSION ${VERSION}.citus-1
# install Citus, for Columnar Storage
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-10.2=$CITUS_VERSION \
postgresql-$PG_MAJOR-hll=2.16.citus-1 \
postgresql-$PG_MAJOR-topn=2.4.0 \
&& 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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment