fix(deploy): pass the documented postgres tuning values to postgres

deploy/.env.example documents POSTGRES_MAX_CONNECTIONS,
POSTGRES_SHARED_BUFFERS, POSTGRES_EFFECTIVE_CACHE_SIZE and
POSTGRES_MAINTENANCE_WORK_MEM, with notes on how to size them — but no
compose file ever passes them to the postgres container. A user who sets
them in .env gets nothing, silently.

Wire them into the postgres command in deploy/docker-compose.yml. The
fallbacks are the postgres:18 stock defaults (100 / 128MB / 4GB / 64MB),
so a deploy that does not set the variables behaves exactly as before.

Checked with postgres:18-alpine: with the variables unset, SHOW gives
the stock values; with them set (1024 / 1GB / 6GB / 128MB), SHOW gives
the set values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Nick
2026-07-19 12:17:31 +07:00
co-authored by Claude Fable 5
parent d4b9797ff7
commit 340dc99e02
+9
View File
@@ -202,6 +202,15 @@ services:
nofile:
soft: 100000
hard: 100000
# Pass the tuning values documented in .env.example to postgres. The
# fallbacks are the postgres:18 stock defaults, so nothing changes when
# the variables are not set.
command: >
postgres
-c max_connections=${POSTGRES_MAX_CONNECTIONS:-100}
-c shared_buffers=${POSTGRES_SHARED_BUFFERS:-128MB}
-c effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-4GB}
-c maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-64MB}
volumes:
- postgres_data:/var/lib/postgresql/data
environment: