11#! /usr/bin/env bash
22set -e
33
4- # Description: TimescaleDB time-series database for code insights data.
4+ # Description: PostgreSQL database for code insights data.
55#
66# Disk: 128GB / persistent SSD
77# Network: 1Gbps
@@ -11,20 +11,25 @@ set -e
1111#
1212VOLUME=" $HOME /sourcegraph-docker/codeinsights-db-disk"
1313./ensure-volume.sh $VOLUME 999
14+
15+ # Remove timescaledb from the shared_preload_libraries configuration
16+ # This step can be performed manually instead of run as part of the deploy script
17+ sed -r -i " s/[#]*\s*(shared_preload_libraries)\s*=\s*'timescaledb(.*)\'/\1 = '\2'/;s/,'/'/" $VOLUME /pgdata/postgresql.conf
18+
1419docker run --detach \
1520 --name=codeinsights-db \
1621 --network=sourcegraph \
1722 --restart=always \
1823 --cpus=4 \
1924 --memory=2g \
25+ -e POSTGRES_DB=postgres \
2026 -e POSTGRES_PASSWORD=password \
27+ -e POSTGRES_USER=postgres \
2128 -e PGDATA=/var/lib/postgresql/data/pgdata \
2229 -v $VOLUME :/var/lib/postgresql/data/ \
2330 index.docker.io/sourcegraph/codeinsights-db:3.36.3@sha256:98133abeb1fc6d02ee9f0fca6cc3ab65e2a3a47a07db96a56aa0869389393fce
2431
25- # Note: You should deploy this as a container, do not try to connect it to your external
26- # Postgres deployment (TimescaleDB is a bit special and most hosted Postgres deployments
27- # do not support TimescaleDB, the data here is akin to gitserver's data, where losing it
28- # would be bad but it can be rebuilt given enough time.)
32+ # Sourcegraph requires PostgreSQL 12+. Generally newer versions are better,
33+ # but anything 12 and higher is supported.
2934
3035echo " Deployed codeinsights-db service"
0 commit comments