fix: add POSTGRES_* environment variables for TypeORM

TypeORM config reads individual POSTGRES_HOST, POSTGRES_PORT, etc.
environment variables instead of DATABASE_URL. Added these variables
to all backend services in docker-compose.yml.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-09 10:46:16 -08:00
parent 4b6778cc29
commit c9b5c4d2d7
2 changed files with 29 additions and 1 deletions

View File

@ -10,7 +10,10 @@
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git remote add:*)",
"Bash(git push:*)"
"Bash(git push:*)",
"Bash(docker compose:*)",
"Bash(ssh:*)",
"Bash(ping:*)"
]
}
}

View File

@ -151,6 +151,11 @@ services:
environment:
NODE_ENV: production
PORT: 3001
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-iconsulting}
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-iconsulting}
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379
JWT_SECRET: ${JWT_SECRET:-your-jwt-secret-key}
@ -174,6 +179,11 @@ services:
environment:
NODE_ENV: production
PORT: 3002
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-iconsulting}
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-iconsulting}
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379
ALIPAY_APP_ID: ${ALIPAY_APP_ID}
@ -203,6 +213,11 @@ services:
environment:
NODE_ENV: production
PORT: 3003
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-iconsulting}
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-iconsulting}
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379
NEO4J_URI: bolt://neo4j:7687
@ -230,6 +245,11 @@ services:
environment:
NODE_ENV: production
PORT: 3004
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-iconsulting}
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-iconsulting}
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
@ -255,6 +275,11 @@ services:
environment:
NODE_ENV: production
PORT: 3005
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-iconsulting}
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-iconsulting}
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}