-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
206 lines (193 loc) · 6.87 KB
/
docker-compose.yml
File metadata and controls
206 lines (193 loc) · 6.87 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
203
204
205
206
name: telli-local
# =============================================================
# Telli Local Deployment
#
# Usage:
# 1. Copy .env.example to .env and fill in LLM_API_KEY
# (or run setup.ps1 / setup.sh for guided setup)
# 2. docker compose up -d
# 3. Open http://localhost:3000
#
# Services:
# telli-dialog -> http://localhost:3000 (main chat app)
# telli-admin -> http://localhost:3001 (admin panel)
# telli-api -> http://localhost:3002 (LLM proxy API)
# keycloak -> http://localhost:8080 (identity provider)
# rabbitmq mgmt -> http://localhost:15672 (user: user / pass: password)
# =============================================================
services:
# -----------------------------------------------------------
# Infrastructure: PostgreSQL with pgvector
# -----------------------------------------------------------
postgres:
image: pgvector/pgvector:pg16
restart: unless-stopped
environment:
POSTGRES_DB: telli_dialog_db
POSTGRES_USER: telli
POSTGRES_PASSWORD: ${DB_PASSWORD:-telli-local-1234}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U telli -d telli_dialog_db']
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# -----------------------------------------------------------
# Infrastructure: Valkey (Redis-compatible cache)
# -----------------------------------------------------------
valkey:
image: ghcr.io/valkey-io/valkey:8
restart: unless-stopped
volumes:
- valkey_data:/data
ports:
- "6379:6379"
# -----------------------------------------------------------
# Infrastructure: Keycloak (Identity Provider)
# -----------------------------------------------------------
fix-keycloak-volume-ownership:
image: alpine
restart: "no"
entrypoint: /bin/sh -c "chown 1000 /keycloak"
volumes:
- keycloak_data:/keycloak
keycloak:
image: quay.io/keycloak/keycloak:26.5.5
restart: unless-stopped
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
CLIENT_NAME: telli-dev-client
CLIENT_SECRET: ClientSecret
entrypoint: /opt/keycloak/data/import/entrypoint.sh
volumes:
- keycloak_data:/opt/keycloak/data/h2
- ./keycloak:/opt/keycloak/data/import
ports:
- "8080:8080"
depends_on:
fix-keycloak-volume-ownership:
condition: service_completed_successfully
# -----------------------------------------------------------
# Infrastructure: RabbitMQ (Message Broker)
# -----------------------------------------------------------
rabbitmq:
image: rabbitmq:4-management
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
ports:
- "5672:5672"
- "15672:15672"
# -----------------------------------------------------------
# One-shot: Database Seeder
# Seeds both databases with required initial data.
# Runs once; all app services wait for it to complete.
# -----------------------------------------------------------
db-seeder:
build:
context: ./seed
dockerfile: Dockerfile
restart: "no"
environment:
API_DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_api_db
DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_dialog_db
LLM_API_KEY: ${LLM_API_KEY}
LLM_BASE_URL: ${LLM_BASE_URL}
LLM_CHAT_MODEL: ${LLM_CHAT_MODEL:-gpt-4o-mini}
depends_on:
postgres:
condition: service_healthy
# -----------------------------------------------------------
# Application: Telli API (LLM Proxy)
# -----------------------------------------------------------
telli-api:
image: ghcr.io/fwu-de/telli-api:latest
restart: unless-stopped
environment:
API_DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_api_db
API_BASE_URL: http://localhost:3002
LOG_LEVEL: info
ports:
- "3002:3002"
depends_on:
db-seeder:
condition: service_completed_successfully
# -----------------------------------------------------------
# Application: Telli Dialog (Main Chat App)
# -----------------------------------------------------------
telli-dialog:
image: ghcr.io/fwu-de/telli-dialog:latest
restart: unless-stopped
environment:
DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_dialog_db
API_DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_api_db
API_URL: http://telli-api:3002
NEXTAUTH_URL: http://localhost:3000
AUTH_SECRET: ${AUTH_SECRET}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
VIDIS_CLIENT_ID: telli-dev-client
VIDIS_CLIENT_SECRET: ClientSecret
VIDIS_BASE_URI: http://localhost:8080/realms/telli-local
VIDIS_ISSUER_URI: http://localhost:8080/realms/telli-local
VALKEY_URL: redis://valkey:6379/0
RABBITMQ_URI: amqp://user:password@rabbitmq:5672
# Fixed local API key – set by the db-seeder (see seed.js)
API_KEY: sk-local.telli-local-secret-not-for-production
DB_CACHE_TTL_SECONDS: "300"
ports:
- "3000:3000"
depends_on:
db-seeder:
condition: service_completed_successfully
telli-api:
condition: service_started
# -----------------------------------------------------------
# Application: Telli Admin (Administration Panel)
# -----------------------------------------------------------
telli-admin:
image: ghcr.io/fwu-de/telli-admin:latest
restart: unless-stopped
environment:
DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_dialog_db
API_DATABASE_URL: postgresql://telli:${DB_PASSWORD:-telli-local-1234}@postgres:5432/telli_api_db
NEXTAUTH_URL: http://localhost:3001
AUTH_SECRET: ${AUTH_SECRET}
ports:
- "3001:3001"
depends_on:
db-seeder:
condition: service_completed_successfully
# -----------------------------------------------------------
# Optional: Crawl4AI (Web Crawling for RAG)
# Uncomment to enable web page ingestion features.
# Requires 1-2 GB RAM.
# -----------------------------------------------------------
# crawl4ai:
# image: unclecode/crawl4ai:0.8.0
# restart: unless-stopped
# ports:
# - "11235:11235"
# deploy:
# resources:
# limits:
# memory: "2gb"
# reservations:
# memory: "1gb"
# shm_size: "2gb"
# healthcheck:
# test: ['CMD', 'curl', '-f', 'http://localhost:11235/health']
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 40s
volumes:
postgres_data:
valkey_data:
keycloak_data: