forked from HKUDS/DeepTutor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (94 loc) · 3.73 KB
/
docker-compose.yml
File metadata and controls
101 lines (94 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# ============================================
# DeepTutor Docker Compose Configuration
# ============================================
# This file provides orchestration for DeepTutor services
#
# Usage:
# Production: docker compose up -d
# Development: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
# Build only: docker compose build
#
# Prerequisites:
# 1. Copy .env.example to .env and configure your API keys
# 2. Optionally customize config/main.yaml and config/agents.yaml
# ============================================
services:
# ============================================
# All-in-One DeepTutor Service
# ============================================
deeptutor:
build:
context: .
dockerfile: Dockerfile
target: production
args:
# Pass backend port at build time for Next.js static optimization
- BACKEND_PORT=${BACKEND_PORT:-8001}
container_name: deeptutor
restart: unless-stopped
ports:
- "${BACKEND_PORT:-8001}:${BACKEND_PORT:-8001}"
- "${FRONTEND_PORT:-3782}:${FRONTEND_PORT:-3782}"
# Load environment variables from .env file
env_file:
- .env
environment:
# LLM Configuration (Required)
- LLM_BINDING=${LLM_BINDING:-openai}
- LLM_MODEL=${LLM_MODEL}
- LLM_API_KEY=${LLM_API_KEY}
- LLM_HOST=${LLM_HOST}
- DISABLE_SSL_VERIFY=${DISABLE_SSL_VERIFY:-false}
# Embedding Configuration (Required for Knowledge Base)
- EMBEDDING_BINDING=${EMBEDDING_BINDING:-openai}
- EMBEDDING_MODEL=${EMBEDDING_MODEL:-text-embedding-3-large}
- EMBEDDING_API_KEY=${EMBEDDING_API_KEY}
- EMBEDDING_HOST=${EMBEDDING_HOST}
- EMBEDDING_DIMENSION=${EMBEDDING_DIMENSION:-3072}
- EMBEDDING_MAX_TOKENS=${EMBEDDING_MAX_TOKENS:-8192}
# TTS Configuration (Optional)
- TTS_MODEL=${TTS_MODEL:-}
- TTS_API_KEY=${TTS_API_KEY:-}
- TTS_URL=${TTS_URL:-}
- TTS_VOICE=${TTS_VOICE:-alloy}
# Web Search Configuration (Optional)
- SEARCH_PROVIDER=${SEARCH_PROVIDER:-perplexity}
- SEARCH_API_KEY=${SEARCH_API_KEY:-}
# Logging: Configure in config/main.yaml -> logging.level
# ============================================
# Service Ports Configuration
# ============================================
# Backend API port (default: 8001)
- BACKEND_PORT=${BACKEND_PORT:-8001}
# Frontend web port (default: 3782)
- FRONTEND_PORT=${FRONTEND_PORT:-3782}
# ============================================
# API URL Configuration (Important for Cloud Deployment)
# ============================================
# For CLOUD/REMOTE deployment: Set this to your server's public URL
# Example: https://your-server.com:8001 or https://api.yourdomain.com
# If not set, defaults to http://localhost:${BACKEND_PORT} (only works locally)
- NEXT_PUBLIC_API_BASE_EXTERNAL=${NEXT_PUBLIC_API_BASE_EXTERNAL:-}
# Alternative: Direct API base URL (same priority as NEXT_PUBLIC_API_BASE_EXTERNAL)
- NEXT_PUBLIC_API_BASE=${NEXT_PUBLIC_API_BASE:-}
volumes:
# Mount local config directory (read-only)
- ./config:/app/config:ro
# Mount local data directory for persistence (read-write)
# This ensures all outputs go to your local ./data directory
- ./data/user:/app/data/user
- ./data/knowledge_bases:/app/data/knowledge_bases
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_PORT:-8001}/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- deeptutor-network
# ============================================
# Networks
# ============================================
networks:
deeptutor-network:
driver: bridge