2026-08-07 09:28:35 +00:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
|
|
services:
|
2026-08-07 09:38:37 +00:00
|
|
|
# PostgreSQL Database Service
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:16-alpine
|
|
|
|
|
container_name: balance-sheet-postgres
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_DB: balance_sheet_db
|
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres_secure_pass_2026}
|
|
|
|
|
ports:
|
2026-08-07 10:35:45 +00:00
|
|
|
# Use POSTGRES_HOST_PORT (default 7001) to prevent conflicts on standard DB host ports
|
|
|
|
|
- "${POSTGRES_HOST_PORT:-7001}:5432"
|
2026-08-07 09:38:37 +00:00
|
|
|
volumes:
|
|
|
|
|
- postgres_db_data:/var/lib/postgresql/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d balance_sheet_db"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
|
|
# Express + React Application Web Service
|
2026-08-07 09:28:35 +00:00
|
|
|
balance-sheet-portal:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
image: balance-sheet-portal:latest
|
|
|
|
|
container_name: balance-sheet-portal
|
|
|
|
|
restart: unless-stopped
|
2026-08-07 09:38:37 +00:00
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
2026-08-07 10:03:37 +00:00
|
|
|
ports:
|
2026-08-07 10:35:45 +00:00
|
|
|
# Use HOST_PORT (default 7000) to prevent conflicts with other web applications
|
|
|
|
|
- "${HOST_PORT:-7000}:3000"
|
2026-08-07 09:28:35 +00:00
|
|
|
environment:
|
|
|
|
|
- NODE_ENV=production
|
2026-08-07 10:35:45 +00:00
|
|
|
- PORT=3000
|
2026-08-07 09:38:37 +00:00
|
|
|
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres_secure_pass_2026}@postgres:5432/balance_sheet_db
|
2026-08-07 09:28:35 +00:00
|
|
|
- DATA_PATH=/app/data/portal-data.json
|
2026-08-07 10:35:45 +00:00
|
|
|
- SMTP_HOST=${SMTP_HOST:-}
|
|
|
|
|
- SMTP_PORT=${SMTP_PORT:-}
|
|
|
|
|
- SMTP_USER=${SMTP_USER:-}
|
|
|
|
|
- SMTP_PASS=${SMTP_PASS:-}
|
|
|
|
|
- SMTP_FROM=${SMTP_FROM:-}
|
|
|
|
|
- SMTP_USE_TLS=${SMTP_USE_TLS:-}
|
2026-08-07 09:28:35 +00:00
|
|
|
volumes:
|
|
|
|
|
- portal_data:/app/data
|
|
|
|
|
healthcheck:
|
2026-08-07 10:35:45 +00:00
|
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
2026-08-07 09:28:35 +00:00
|
|
|
interval: 30s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
portal_data:
|
|
|
|
|
name: balance_sheet_portal_data
|
|
|
|
|
driver: local
|
2026-08-07 09:38:37 +00:00
|
|
|
postgres_db_data:
|
|
|
|
|
name: balance_sheet_postgres_data
|
|
|
|
|
driver: local
|