Files
ai-contract-platform/docker-compose.server.yml
T
2026-05-01 08:57:22 +08:00

71 lines
1.7 KiB
YAML

version: "3.9"
services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_DB: ai_contract_platform
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d ai_contract_platform"]
interval: 5s
timeout: 5s
retries: 20
redis:
image: redis:7
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
environment:
APP_NAME: AI Contract Platform
APP_ENV: production
SECRET_KEY: ${SECRET_KEY:?Set SECRET_KEY in .env before starting production}
DATABASE_URL: postgresql+psycopg://postgres:postgres@postgres:5432/ai_contract_platform
REDIS_URL: redis://redis:6379/0
MINIO_ENDPOINT: 192.168.3.90:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO_BUCKET: contracts
command: >
sh -c "alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000"
volumes:
- backend_storage:/app/storage
ports:
- "8001:8000"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
BACKEND_BASE_URL: http://backend:8000
restart: unless-stopped
depends_on:
backend:
condition: service_started
environment:
NEXT_PUBLIC_API_BASE_URL: /api/v1
BACKEND_BASE_URL: http://backend:8000
NODE_ENV: production
ports:
- "3003:3000"
volumes:
postgres_data:
backend_storage: