Description
The deployment/docker-compose.yml defines four services (frontend, backend, redis, monitoring) but omits a PostgreSQL service. The backend requires a Postgres connection at startup — it connects on boot, runs migrations, and will crash if the database is unreachable.
Steps to Reproduce
git clone https://github.com/grantFoxin/SentientFi
cd SentientFi/deployment
cp ../backend/.env.example .env
docker compose up
Expected: All services start, migrations run, backend reports healthy.
Actual: Backend exits immediately with:
Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect
Root Cause
deployment/docker-compose.yml has no postgres service. The backend's DATABASE_URL in .env.example points to postgresql://portfolio_user:portfolio_pass@localhost:5432/stellar_portfolio but nothing starts that database.
The Redis service is correctly defined, proving the pattern works — it's just missing for Postgres.
Evidence
backend/.env.example line 14:
DATABASE_URL=postgresql://portfolio_user:portfolio_pass@localhost:5432/stellar_portfolio
backend/src/db/client.ts — connects on module load, throws if unreachable.
backend/src/db/migrate.ts — runs on startup, requires live Postgres.
deployment/docker-compose.yml services defined: frontend, backend, redis, monitoring — no postgres.
Proposed Fix
Add a postgres service to deployment/docker-compose.yml and make backend depend on it:
services:
postgres:
image: postgres:15-alpine
container_name: portfolio-postgres
restart: unless-stopped
environment:
POSTGRES_USER: portfolio_user
POSTGRES_PASSWORD: portfolio_pass
POSTGRES_DB: stellar_portfolio
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U portfolio_user -d stellar_portfolio"]
interval: 10s
timeout: 5s
retries: 5
backend:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
# ... rest of backend config
volumes:
postgres_data:
Also update backend service's environment section to reference the container hostname (postgres) instead of localhost.
Impact
Severity: Critical — The advertised Docker deployment path is completely broken. Any developer following the README's "Docker Deployment" section will hit this error. No workaround without manually starting a Postgres instance.
Environment
- Docker version: 24+
- docker compose version: v2
- File:
deployment/docker-compose.yml
Description
The
deployment/docker-compose.ymldefines four services (frontend,backend,redis,monitoring) but omits a PostgreSQL service. The backend requires a Postgres connection at startup — it connects on boot, runs migrations, and will crash if the database is unreachable.Steps to Reproduce
git clone https://github.com/grantFoxin/SentientFi cd SentientFi/deployment cp ../backend/.env.example .env docker compose upExpected: All services start, migrations run, backend reports healthy.
Actual: Backend exits immediately with:
Root Cause
deployment/docker-compose.ymlhas nopostgresservice. The backend'sDATABASE_URLin.env.examplepoints topostgresql://portfolio_user:portfolio_pass@localhost:5432/stellar_portfoliobut nothing starts that database.The Redis service is correctly defined, proving the pattern works — it's just missing for Postgres.
Evidence
backend/.env.exampleline 14:backend/src/db/client.ts— connects on module load, throws if unreachable.backend/src/db/migrate.ts— runs on startup, requires live Postgres.deployment/docker-compose.ymlservices defined:frontend,backend,redis,monitoring— nopostgres.Proposed Fix
Add a
postgresservice todeployment/docker-compose.ymland makebackenddepend on it:Also update
backendservice'senvironmentsection to reference the container hostname (postgres) instead oflocalhost.Impact
Severity: Critical — The advertised Docker deployment path is completely broken. Any developer following the README's "Docker Deployment" section will hit this error. No workaround without manually starting a Postgres instance.
Environment
deployment/docker-compose.yml