mirror of
https://github.com/RustyRaptor/deploy-sourcegraph-docker.git
synced 2026-12-03 15:55:17 -07:00
Update pure-docker code insights deployment to use postgres (#781)
This commit is contained in:
1 parent
0b0ec2644c
commit
0e03697279
1 file changed
+10
-5
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Description: TimescaleDB time-series database for code insights data.
|
||||
# Description: PostgreSQL database for code insights data.
|
||||
#
|
||||
# Disk: 128GB / persistent SSD
|
||||
# Network: 1Gbps
|
||||
@@ -11,20 +11,25 @@ set -e
|
||||
#
|
||||
VOLUME="$HOME/sourcegraph-docker/codeinsights-db-disk"
|
||||
./ensure-volume.sh $VOLUME 999
|
||||
|
||||
# Remove timescaledb from the shared_preload_libraries configuration
|
||||
# This step can be performed manually instead of run as part of the deploy script
|
||||
sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'timescaledb(.*)\'/\1 = '\2'/;s/,'/'/" $VOLUME/pgdata/postgresql.conf
|
||||
|
||||
docker run --detach \
|
||||
--name=codeinsights-db \
|
||||
--network=sourcegraph \
|
||||
--restart=always \
|
||||
--cpus=4 \
|
||||
--memory=2g \
|
||||
-e POSTGRES_DB=postgres \
|
||||
-e POSTGRES_PASSWORD=password \
|
||||
-e POSTGRES_USER=postgres \
|
||||
-e PGDATA=/var/lib/postgresql/data/pgdata \
|
||||
-v $VOLUME:/var/lib/postgresql/data/ \
|
||||
index.docker.io/sourcegraph/codeinsights-db:3.36.3@sha256:98133abeb1fc6d02ee9f0fca6cc3ab65e2a3a47a07db96a56aa0869389393fce
|
||||
|
||||
# Note: You should deploy this as a container, do not try to connect it to your external
|
||||
# Postgres deployment (TimescaleDB is a bit special and most hosted Postgres deployments
|
||||
# do not support TimescaleDB, the data here is akin to gitserver's data, where losing it
|
||||
# would be bad but it can be rebuilt given enough time.)
|
||||
# Sourcegraph requires PostgreSQL 12+. Generally newer versions are better,
|
||||
# but anything 12 and higher is supported.
|
||||
|
||||
echo "Deployed codeinsights-db service"
|
||||
Reference in new issue
Block a user