From 6eb3fd88458ede1479fbd020a992b11d23a6b337 Mon Sep 17 00:00:00 2001 From: fluffy-marmot <10621013+fluffy-marmot@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:28:54 -0700 Subject: [PATCH 1/4] fix misnamed environment var --- src/db/migration-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/migration-entrypoint.sh b/src/db/migration-entrypoint.sh index 2f0bcea..4544723 100755 --- a/src/db/migration-entrypoint.sh +++ b/src/db/migration-entrypoint.sh @@ -2,7 +2,7 @@ set -e -until pg_isready -h "$POSTGRES_HOST" -U "$POSTGRES_USER" -d "$POSTGRES_DATABASE"; do +until pg_isready -h "$POSTGRES_HOST" -U "$POSTGRES_USER" -d "$POSTGRES_DB"; do sleep 1 done From d9fadd39aba8e7d69eaf016f0818a44ff82dc094 Mon Sep 17 00:00:00 2001 From: fluffy-marmot <10621013+fluffy-marmot@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:32:41 -0700 Subject: [PATCH 2/4] remove CREATE DATABASE block in init.sql; CREATE DATABASE cannot be used within DO 33470 block, at best this fails silently if POSTGRES_DB=eos because docker creates the database anyway beforehand, and errors out if db is renamed to something else --- src/db/init.sql | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/db/init.sql b/src/db/init.sql index 33462ab..e07eb6d 100644 --- a/src/db/init.sql +++ b/src/db/init.sql @@ -1,10 +1,3 @@ -DO $$ -BEGIN - IF NOT EXISTS (SELECT FROM pg_database WHERE datname = 'eos') THEN - CREATE DATABASE eos; - END IF; -END $$; - -- Create serversettings table CREATE TABLE IF NOT EXISTS serversettings ( id SERIAL PRIMARY KEY, From 3d746345bae9d600bc6203a22a31dca45dc271e2 Mon Sep 17 00:00:00 2001 From: fluffy-marmot <10621013+fluffy-marmot@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:39:24 -0700 Subject: [PATCH 3/4] fix for POSTGRES_PORT being used for DATABASE_URL to specify the port number within the container, but in docker-compose.yml the container port number is inflexibly hardcoded to 5432. Add a new envvar to specify port number used by host system in case 5432 conflicts with host's psql --- src/.env.EXAMPLE | 3 ++- src/docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/.env.EXAMPLE b/src/.env.EXAMPLE index 328e54f..8cbd23d 100644 --- a/src/.env.EXAMPLE +++ b/src/.env.EXAMPLE @@ -18,7 +18,8 @@ STREAM_LOGS=True # Database — don't change unless you know what you're doing POSTGRES_HOST=postgres -POSTGRES_PORT=5432 +POSTGRES_PORT=5432 # used in container +POSTGRES_PORT_HOST=5432 # host system only PGUSER=postgres # POSTGRES_USER must match PGUSER — the postgres image uses this to create the superuser POSTGRES_USER=postgres diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 19312a3..038290a 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -60,7 +60,7 @@ services: retries: 5 start_period: 20s ports: - - "127.0.0.1:${POSTGRES_PORT}:5432" + - "127.0.0.1:${POSTGRES_PORT_HOST}:${POSTGRES_PORT}" networks: - eos restart: unless-stopped From fbbbd9b027dbd10a10ee1cb68933e725fd262d2c Mon Sep 17 00:00:00 2001 From: fluffy-marmot <10621013+fluffy-marmot@users.noreply.github.com> Date: Thu, 25 Jun 2026 04:53:45 -0700 Subject: [PATCH 4/4] address PR review concerns: add fallback value for POSTGRES_PORT_HOST, fix readme, remove inline comments in .env --- README.md | 3 ++- src/.env.EXAMPLE | 4 ++-- src/docker-compose.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61243a3..3b98f80 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ What it does: ## Configuration -If you already have postgres installed on your system then you may have conflicting ports, in that case change the `POSTGRES_PORT` to a free port in the `.env`, usually `5433`. Then rebuild by using following command: +If you already have postgres installed on your system then you may have conflicting ports, in that case change +the `POSTGRES_PORT_HOST` to a free port in the `.env`, usually `5433`. (Clarification:`POSTGRES_PORT` env variable is only used within the container environment). Then rebuild by using following command: ``` docker compose up -d --build ``` diff --git a/src/.env.EXAMPLE b/src/.env.EXAMPLE index 8cbd23d..eeff674 100644 --- a/src/.env.EXAMPLE +++ b/src/.env.EXAMPLE @@ -18,8 +18,8 @@ STREAM_LOGS=True # Database — don't change unless you know what you're doing POSTGRES_HOST=postgres -POSTGRES_PORT=5432 # used in container -POSTGRES_PORT_HOST=5432 # host system only +POSTGRES_PORT=5432 +POSTGRES_PORT_HOST=5432 PGUSER=postgres # POSTGRES_USER must match PGUSER — the postgres image uses this to create the superuser POSTGRES_USER=postgres diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 038290a..e2b0212 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -60,7 +60,7 @@ services: retries: 5 start_period: 20s ports: - - "127.0.0.1:${POSTGRES_PORT_HOST}:${POSTGRES_PORT}" + - "127.0.0.1:${POSTGRES_PORT_HOST:-5432}:${POSTGRES_PORT}" networks: - eos restart: unless-stopped