forked from murtaza-nasir/maestro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
202 lines (194 loc) · 6.7 KB
/
docker-compose.yml
File metadata and controls
202 lines (194 loc) · 6.7 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
services:
# PostgreSQL database for document management
postgres:
image: pgvector/pgvector:pg15
container_name: maestro-postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-maestro_db}
POSTGRES_USER: ${POSTGRES_USER:-maestro_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-maestro_password}
volumes:
- postgres-data:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
networks:
- maestro-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-maestro_user} -d ${POSTGRES_DB:-maestro_db}"]
interval: 10s
timeout: 5s
retries: 5
# Nginx reverse proxy - single entry point for the application
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
image: maestro-nginx
container_name: maestro-nginx
ports:
- "${MAESTRO_PORT:-80}:80"
depends_on:
- backend
- frontend
networks:
- maestro-network
restart: unless-stopped
backend:
build:
context: ./maestro_backend
dockerfile: Dockerfile
image: maestro-backend
container_name: maestro-backend
depends_on:
postgres:
condition: service_healthy
volumes:
- maestro-data:/app/ai_researcher/data
- ./maestro_model_cache:/root/.cache/huggingface
- ./maestro_datalab_cache:/root/.cache/datalab
- ./reports:/app/reports
- ./maestro_backend/data:/app/data
working_dir: /app
environment:
- DEBUG_MESSENGER=true
- MESSENGER_SIMPLE_PROMPT=true
- DEBUG_PLANNING=true
- DEBUG_REFLECTION=true
- MAX_WORKER_THREADS=${MAX_WORKER_THREADS:-10}
- TZ=${TZ:-UTC}
- LOG_LEVEL=${LOG_LEVEL:-ERROR}
# CORS configuration for reverse proxy support
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-*}
# Allow all origins in development mode when using nginx proxy
- ALLOW_CORS_WILDCARD=${ALLOW_CORS_WILDCARD:-true}
# PostgreSQL connection - uses environment variables
- DATABASE_URL=postgresql://${POSTGRES_USER:-maestro_user}:${POSTGRES_PASSWORD:-maestro_password}@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-maestro_db}
# Admin credentials for initial setup
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
# JWT Secret for authentication
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-change-this}
networks:
- maestro-network
# GPU support - uncomment the following lines if you have a GPU and nvidia-container-toolkit installed
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['${BACKEND_GPU_DEVICE:-0}']
capabilities: [gpu]
frontend:
build:
context: ./maestro_frontend
dockerfile: Dockerfile
# No build args needed - using relative URLs through nginx proxy
image: maestro-frontend
container_name: maestro-frontend
# Frontend is now only accessible through nginx, not directly exposed
# ports:
# - "${FRONTEND_HOST}:${FRONTEND_PORT}:${FRONTEND_INTERNAL_PORT}"
depends_on:
- backend
networks:
- maestro-network
environment:
# API URLs (optional - using relative URLs through nginx proxy by default)
- VITE_SERVER_TIMEZONE=${VITE_SERVER_TIMEZONE:-UTC}
- TZ=${TZ:-UTC}
- LOG_LEVEL=${LOG_LEVEL:-ERROR}
doc-processor:
build:
context: ./maestro_backend
dockerfile: Dockerfile
image: maestro-doc-processor # Unique image name
container_name: maestro-doc-processor
command: ["python", "-u", "services/background_document_processor.py"]
working_dir: /app
volumes:
- maestro-data:/app/ai_researcher/data
- ./maestro_model_cache:/root/.cache/huggingface
- ./maestro_datalab_cache:/root/.cache/datalab
- ./reports:/app/reports
- ./maestro_backend/data:/app/data
depends_on:
- backend
networks:
- maestro-network
environment:
- TZ=${TZ:-UTC}
- LOG_LEVEL=${LOG_LEVEL:-ERROR}
# PostgreSQL connection - same as backend
- DATABASE_URL=postgresql://${POSTGRES_USER:-maestro_user}:${POSTGRES_PASSWORD:-maestro_password}@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-maestro_db}
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['${DOC_PROCESSOR_GPU_DEVICE:-0}']
capabilities: [gpu]
# CLI service for document ingestion and management
cli:
build:
context: ./maestro_backend
dockerfile: Dockerfile
image: maestro-cli # Unique image name
container_name: maestro-cli
working_dir: /app
volumes:
- maestro-data:/app/ai_researcher/data
- ./maestro_model_cache:/root/.cache/huggingface
- ./maestro_datalab_cache:/root/.cache/datalab
- ./reports:/app/reports
- ./maestro_backend/data:/app/data
# Mount a directory for bulk PDF ingestion
- ./pdfs:/app/pdfs # Read-write mount for PDF files (allows deletion after processing)
depends_on:
- backend
networks:
- maestro-network
environment:
- TZ=${TZ:-UTC}
- LOG_LEVEL=${LOG_LEVEL:-ERROR}
# PostgreSQL connection - same as backend
- DATABASE_URL=postgresql://${POSTGRES_USER:-maestro_user}:${POSTGRES_PASSWORD:-maestro_password}@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-maestro_db}
# Performance settings from .env (optional, with defaults)
- TRANSFORMERS_VERBOSITY=${TRANSFORMERS_VERBOSITY:-error}
- TOKENIZERS_PARALLELISM=${TOKENIZERS_PARALLELISM:-false}
- TF_CPP_MIN_LOG_LEVEL=${TF_CPP_MIN_LOG_LEVEL:-3}
- PYTHONWARNINGS=${PYTHONWARNINGS:-ignore}
profiles:
- cli # This service only runs when explicitly requested
# GPU support for CLI operations (embedding, etc.)
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['${CLI_GPU_DEVICE:-0}']
capabilities: [gpu]
# Optional: Add a service for local LLM if needed
# local-llm:
# image: ghcr.io/ollama/ollama:latest
# container_name: local-llm
# volumes:
# - ollama-data:/root/.ollama
# ports:
# - "${LOCAL_LLM_HOST}:${LOCAL_LLM_PORT}:${LOCAL_LLM_INTERNAL_PORT}"
# restart: unless-stopped
# # GPU support for local LLM - uncomment if needed
# # deploy:
# # resources:
# # reservations:
# # devices:
# # - driver: nvidia
# # count: 1
# # capabilities: [gpu]
volumes:
postgres-data:
maestro-data:
networks:
maestro-network:
driver: bridge