From eda228b0cb2f76607cfa0c1531eea7793358e76d Mon Sep 17 00:00:00 2001 From: Edimo Date: Thu, 7 May 2026 17:46:00 -0300 Subject: [PATCH] Restore 'database' DNS alias on the postgres compose service The database service declares hostname: database-app-container, which on some Docker/Compose versions causes the embedded DNS to register *only* that hostname and drop the default service-name alias. Result: web and sidekiq containers cannot resolve "database" (the value used in backend/.env's POSTGRES_HOST), even though "database-app-container" works. Adding an explicit network alias keeps both names resolvable without changing the .env contract. Verified: getent hosts database / database-app-container both return the same IP, and bin/rails runner can SELECT 1 without POSTGRES_HOST overrides. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index a58319a..503e4e1 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -39,6 +39,10 @@ services: healthcheck: test: pg_isready -U postgres -h 127.0.0.1 interval: 5s + networks: + default: + aliases: + - database elasticsearch: image: elasticsearch:8.10.2 environment: