mirror of
https://github.com/RustyRaptor/deploy-sourcegraph-docker.git
synced 2026-12-04 08:15:24 -07:00
I previously thought `PGDATA=/var/lib/postgresql/data/pgdata` was the default, but it is definitely not: `/var/lib/postgresql/data` is. I removed this from `deploy-codeinsights-db.sh` for consistency with the Docker Compose deployment, but this would have broken existing pure-docker deployments because they were storing data in the `pgdata` subdirectory previously. I have added this to Docker Compose deployments here, for consistency, although it is not strictly required (Docker Compose volumes, unlike Kubernetes ones, do not appear ot have a `lost+found` file in them and as such Postgres is happy to use the root of the volume - whereas in Kubernetes deployments it will complain the directory is not empty and fail to start.) Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
31 lines
1.1 KiB
Bash
Executable File
31 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# Description: TimescaleDB time-series database for code insights data.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Network: 1Gbps
|
|
# Liveness probe: 5432/TCP
|
|
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
VOLUME="$HOME/sourcegraph-docker/codeinsights-db-disk"
|
|
./ensure-volume.sh $VOLUME 999
|
|
docker run --detach \
|
|
--name=codeinsights-db \
|
|
--network=sourcegraph \
|
|
--restart=always \
|
|
--cpus=4 \
|
|
--memory=2g \
|
|
-e POSTGRES_PASSWORD=password \
|
|
-e PGDATA=/var/lib/postgresql/data/pgdata \
|
|
-v $VOLUME:/var/lib/postgresql/data/ \
|
|
index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:f985af2fef860cc48be40ded864df025b8794b02b86e66cbc6c55bfe3c418831
|
|
|
|
# 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.)
|
|
|
|
echo "Deployed codeinsights-db service"
|