From 08e23de90427031b73764b6ea2cb40e45c539354 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 26 Feb 2021 15:35:43 -0700 Subject: [PATCH] insights: set PGDATA=/var/lib/postgresql/data/pgdata 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 4f1555a7b..0effee8d3 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 d263fa1b6..6613d3d4a 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: