-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1017 from rmartinsen/997-reconfigure-docker-setup
Add timescale and pg_stat_statement postgres extensions
- Loading branch information
Showing
4 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM postgres:16-bullseye | ||
|
||
ENV POSTGIS_MAJOR=3 | ||
ENV POSTGIS_VERSION=3.5.0+dfsg-1.pgdg110+1 | ||
ENV TIMESCALE_MAJOR=2 | ||
ENV TIMESCALE_MINOR=17 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends lsb-release curl gnupg apt-transport-https wget \ | ||
# ca-certificates: for accessing remote raster files; | ||
# fix: https://github.com/postgis/docker-postgis/issues/307 | ||
ca-certificates \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ | ||
# Add timescale repository and key | ||
&& echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" \ | ||
| tee /etc/apt/sources.list.d/timescaledb.list \ | ||
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey \ | ||
| gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg \ | ||
# Install timescaledb | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends timescaledb-$TIMESCALE_MAJOR-postgresql-$PG_MAJOR="$TIMESCALE_MAJOR.$TIMESCALE_MINOR*" postgresql-client-$PG_MAJOR \ | ||
# Remove temporary files | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -f /etc/apt/trusted.gpg.d/timescaledb.gpg | ||
|
||
|
||
RUN mkdir -p /docker-entrypoint-initdb.d | ||
|
||
# Set up TimescaleDB extension during database initialization | ||
RUN echo "shared_preload_libraries='timescaledb'" >> /usr/share/postgresql/postgresql.conf.sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE DATABASE vacantlotdb; | ||
\c vacantlotdb; | ||
CREATE EXTENSION postgis; | ||
CREATE EXTENSION pg_stat_statements; | ||
CREATE EXTENSION timescaledb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters