Files
ai-contract-platform/docker-compose.server.yml
T

98 lines
2.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
shared-ai-platform:
build:
context: ./shared-ai-platform
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- ./shared-ai-platform/.env
command: >
sh -c "uvicorn app.main:app --host 0.0.0.0 --port 8011"
volumes:
- shared_ai_storage:/app/storage
ports:
- "8012:8011"
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8011/health').read()\""]
interval: 10s
timeout: 5s
retries: 12
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
SHARED_AI_PLATFORM_BASE_URL: http://192.168.3.90:18011
SHARED_AI_PLATFORM_API_PREFIX: /api/v0.1
SHARED_AI_PLATFORM_APP_ID: ai-contract-platform
SHARED_AI_PLATFORM_API_KEY: "shared-ai-platform-admin-dev-token"
SHARED_AI_PLATFORM_TIMEOUT_SECONDS: 180
SHARED_AI_PLATFORM_LEGAL_REVIEW_ENABLED: "true"
SHARED_AI_PLATFORM_LEGAL_REVIEW_FALLBACK_TO_LOCAL: "false"
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:
shared_ai_storage: