From e951cc3cf46965bb9cab93c6c3b81533e2e558ee Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Mon, 20 May 2024 12:29:03 +0530 Subject: [PATCH] dev: add pg port to configuration (#4517) --- apiserver/.env.example | 3 ++- apiserver/plane/settings/common.py | 1 + deploy/selfhost/docker-compose.yml | 3 ++- deploy/selfhost/variables.env | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apiserver/.env.example b/apiserver/.env.example index e6590f831..38944f79c 100644 --- a/apiserver/.env.example +++ b/apiserver/.env.example @@ -12,7 +12,8 @@ POSTGRES_USER="plane" POSTGRES_PASSWORD="plane" POSTGRES_HOST="plane-db" POSTGRES_DB="plane" -DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB} +POSTGRES_PORT=5432 +DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} # Redis Settings diff --git a/apiserver/plane/settings/common.py b/apiserver/plane/settings/common.py index a5611fdab..ed756642b 100644 --- a/apiserver/plane/settings/common.py +++ b/apiserver/plane/settings/common.py @@ -151,6 +151,7 @@ else: "USER": os.environ.get("POSTGRES_USER"), "PASSWORD": os.environ.get("POSTGRES_PASSWORD"), "HOST": os.environ.get("POSTGRES_HOST"), + "PORT": os.environ.get("POSTGRES_PORT", "5432"), } } diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index 6f58113be..4d98ec7c9 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -14,6 +14,7 @@ x-app-env: &app-env - POSTGRES_USER=${POSTGRES_USER:-plane} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-plane} - POSTGRES_DB=${POSTGRES_DB:-plane} + - POSTGRES_PORT=${POSTGRES_PORT:-5432} - PGDATA=${PGDATA:-/var/lib/postgresql/data} - DATABASE_URL=${DATABASE_URL:-postgresql://plane:plane@plane-db/plane} # REDIS SETTINGS @@ -145,7 +146,7 @@ services: command: postgres -c 'max_connections=1000' volumes: - pgdata:/var/lib/postgresql/data - + plane-redis: <<: *app-env image: redis:7.2.4-alpine diff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.env index 62c4bc164..08f686c80 100644 --- a/deploy/selfhost/variables.env +++ b/deploy/selfhost/variables.env @@ -18,6 +18,7 @@ PGDATABASE=plane POSTGRES_USER=plane POSTGRES_PASSWORD=plane POSTGRES_DB=plane +POSTGRES_PORT=5432 PGDATA=/var/lib/postgresql/data DATABASE_URL=