-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
140 lines (135 loc) · 4.37 KB
/
docker-compose.yaml
File metadata and controls
140 lines (135 loc) · 4.37 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
# =============================================================================
# AI-Q Blueprint - Docker Compose
# =============================================================================
#
# Services:
# aiq-agent - Backend API server
# frontend - Next.js UI (aiq-blueprint-ui)
# postgres - PostgreSQL for jobs and checkpoints
#
# Build targets (backend only):
# dev - Development build (includes CLI)
# release - Production build (web only, validates env vars)
#
# Usage:
# # Build locally (default)
# cd deploy/compose
# docker compose --env-file ../.env -f docker-compose.yaml up -d --build
# BUILD_TARGET=release docker compose --env-file ../.env -f docker-compose.yaml up -d --build
#
# # Use pre-built images from registry (skip --build)
# BACKEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-agent:2.0.0 \
# FRONTEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-frontend:2.0.0 \
# docker compose --env-file ../.env -f docker-compose.yaml up -d
#
# Frontend image:
# The frontend is built from frontends/ui/Dockerfile.
#
# =============================================================================
services:
aiq-agent:
image: ${BACKEND_IMAGE:-nvcr.io/nvidia/blueprint/aiq-agent:2.0.0}
build:
context: ../..
dockerfile: deploy/Dockerfile
target: ${BUILD_TARGET:-dev}
container_name: aiq-agent
env_file:
- ../.env
environment:
- APP_ENV=${APP_ENV:-production}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
# Database config (with Docker defaults)
- NAT_JOB_STORE_DB_URL=${NAT_JOB_STORE_DB_URL:-postgresql+asyncpg://aiq:aiq_dev@postgres:5432/aiq_jobs}
- AIQ_CHECKPOINT_DB=${AIQ_CHECKPOINT_DB:-postgresql://aiq:aiq_dev@postgres:5432/aiq_checkpoints}
- AIQ_SUMMARY_DB=${AIQ_SUMMARY_DB:-postgresql+psycopg://aiq:aiq_dev@postgres:5432/aiq_jobs}
# LlamaIndex persistence (used by config_web_default_llamaindex.yml)
- AIQ_CHROMA_DIR=${AIQ_CHROMA_DIR:-/app/data/chroma_data}
# Server config
# LlamaIndex (default)
- CONFIG_FILE=${BACKEND_CONFIG:-/app/configs/config_web_default_llamaindex.yml}
- HOST=0.0.0.0
- PORT=8000
# RAG config
# - RAG_SERVER_URL=${RAG_SERVER_URL:-https://rag-backend}
# - RAG_INGEST_URL=${RAG_INGEST_URL:-https://rag-ingest}
# Dask worker config
- DASK_NWORKERS=${DASK_NWORKERS:-1}
- DASK_NTHREADS=${DASK_NTHREADS:-4}
ports:
- "${PORT:-8000}:8000"
volumes:
- ../../configs:/app/configs:ro
- aiq-data:/app/data
networks:
- aiq-network
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
frontend:
image: ${FRONTEND_IMAGE:-nvcr.io/nvidia/blueprint/aiq-frontend:2.0.0}
build:
context: ../../frontends/ui
dockerfile: deploy/Dockerfile
container_name: aiq-blueprint-ui
environment:
- REQUIRE_AUTH=${REQUIRE_AUTH:-false}
- BACKEND_URL=${BACKEND_URL:-http://aiq-agent:8000}
- FILE_UPLOAD_ACCEPTED_TYPES=${FILE_UPLOAD_ACCEPTED_TYPES:-.pdf,.docx,.txt,.md}
- FILE_UPLOAD_MAX_SIZE_MB=${FILE_UPLOAD_MAX_SIZE_MB:-}
- FILE_UPLOAD_MAX_FILE_COUNT=${FILE_UPLOAD_MAX_FILE_COUNT:-}
- FILE_EXPIRATION_CHECK_INTERVAL_HOURS=${FILE_EXPIRATION_CHECK_INTERVAL_HOURS:-}
ports:
- "${FRONTEND_PORT:-3000}:3000"
networks:
- aiq-network
depends_on:
- aiq-agent
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 256M
restart: unless-stopped
postgres:
image: postgres:16-alpine
container_name: aiq-postgres
environment:
POSTGRES_USER: aiq
POSTGRES_PASSWORD: aiq_dev
POSTGRES_DB: aiq_jobs
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
networks:
- aiq-network
stdin_open: true
tty: true
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
healthcheck:
test: ["CMD-SHELL", "pg_isready -U aiq -d aiq_jobs && pg_isready -U aiq -d aiq_checkpoints"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
aiq-data:
driver: local
postgres-data:
driver: local
networks:
aiq-network:
driver: bridge