From 299827ec9d3e5c01eece22f8d760c33a3928c7f5 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 26 Feb 2021 16:18:47 -0700 Subject: [PATCH] insights: set PGDATA=/var/lib/postgresql/data/pgdata (#269) 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 --- deploy-codeinsights-db.sh | 1 + docker-compose/docker-compose.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/deploy-codeinsights-db.sh b/deploy-codeinsights-db.sh index 4f1555a..0effee8 100755 --- a/deploy-codeinsights-db.sh +++ b/deploy-codeinsights-db.sh @@ -18,6 +18,7 @@ docker run --detach \ --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 diff --git a/docker-compose/docker-compose.yaml b/docker-compose/docker-compose.yaml index d263fa1..6613d3d 100644 --- a/docker-compose/docker-compose.yaml +++ b/docker-compose/docker-compose.yaml @@ -530,6 +530,7 @@ services: mem_limit: "2g" environment: - POSTGRES_PASSWORD=password + - PGDATA=/var/lib/postgresql/data/pgdata volumes: - "codeinsights-db:/var/lib/postgresql/data/" networks: