2026-03-25 23:55:36 +07:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
postgres:
|
2026-05-15 12:02:24 +08:00
|
|
|
image: postgres:15-alpine
|
|
|
|
|
restart: unless-stopped
|
2026-03-25 23:55:36 +07:00
|
|
|
environment:
|
2026-05-15 12:02:24 +08:00
|
|
|
POSTGRES_USER: ${DB_USER:-postgres}
|
|
|
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
|
|
|
|
|
POSTGRES_DB: ${DB_NAME:-company_finance}
|
2026-03-25 23:55:36 +07:00
|
|
|
ports:
|
|
|
|
|
- "5432:5432"
|
|
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
2026-05-15 12:02:24 +08:00
|
|
|
- ./backend/migrations:/docker-entrypoint-initdb.d
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
|
|
backend:
|
|
|
|
|
build:
|
|
|
|
|
context: ./backend
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "${BACKEND_PORT:-3000}:3000"
|
|
|
|
|
environment:
|
|
|
|
|
NODE_ENV: production
|
|
|
|
|
PORT: 3000
|
|
|
|
|
DB_HOST: postgres
|
|
|
|
|
DB_PORT: 5432
|
|
|
|
|
DB_NAME: ${DB_NAME:-company_finance}
|
|
|
|
|
DB_USER: ${DB_USER:-postgres}
|
|
|
|
|
DB_PASSWORD: ${DB_PASSWORD:-changeme}
|
|
|
|
|
JWT_SECRET: ${JWT_SECRET:-please-change-this-secret}
|
|
|
|
|
CORS_ORIGIN: ${CORS_ORIGIN:-}
|
|
|
|
|
TENCENT_SECRET_ID: ${TENCENT_SECRET_ID:-}
|
|
|
|
|
TENCENT_SECRET_KEY: ${TENCENT_SECRET_KEY:-}
|
|
|
|
|
COS_BUCKET: ${COS_BUCKET:-}
|
|
|
|
|
COS_REGION: ${COS_REGION:-}
|
|
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
volumes:
|
|
|
|
|
- upload_data:/app/uploads
|
|
|
|
|
|
|
|
|
|
frontend:
|
|
|
|
|
build:
|
|
|
|
|
context: ./frontend
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "${FRONTEND_PORT:-80}:80"
|
|
|
|
|
depends_on:
|
|
|
|
|
- backend
|
2026-03-25 23:55:36 +07:00
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
2026-05-15 12:02:24 +08:00
|
|
|
upload_data:
|