Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
123 lines (115 loc) · 4.27 KB
/
Copy pathcompose.yaml
File metadata and controls
123 lines (115 loc) · 4.27 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
# One of two interchangeable backends is chosen at start-up:
# docker compose --profile dotnet up -> ASP.NET Core + SQL Server 2025, agent: Microsoft Agent Framework
# docker compose --profile node up -> NestJS + PostgreSQL 17, agent: Mastra
# Both serve the same HTTP contract from the same AdventureWorksDW data, under the network name
# data-api, and the agent under /agent in the same process. The app is on http://localhost:8080.
# Without agent/.env, the agent talks to the demo model instead of an LLM (see agent/demo.env).
#
# The agent as a separate Mastra service in front of either backend:
# AGENT_URL=http://agent:4111 docker compose --profile node --profile agent up
name: agentic-analytics
services:
sqlserver:
profiles: [dotnet]
build: db/sqlserver
# Microsoft publishes SQL Server for Linux only for amd64; on Apple Silicon it runs emulated.
platform: linux/amd64
environment:
ACCEPT_EULA: "Y"
MSSQL_PID: Developer
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD:?set MSSQL_SA_PASSWORD in .env}
ANALYTICS_READER_PASSWORD: ${ANALYTICS_READER_PASSWORD:?set ANALYTICS_READER_PASSWORD in .env}
ports:
- 127.0.0.1:${SQLSERVER_PORT:-14330}:1433
volumes:
- sqlserver-data:/var/opt/mssql
healthcheck:
test:
- CMD-SHELL
- /opt/mssql-tools18/bin/sqlcmd -C -b -S localhost -U AnalyticsReader -P "$$ANALYTICS_READER_PASSWORD" -d AdventureWorksDW -Q "SELECT TOP (1) ProductKey FROM analytics.AgentViewProducts"
interval: 5s
retries: 60
postgres:
profiles: [node]
build: db/postgres
environment:
POSTGRES_DB: adventureworks
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
ANALYTICS_READER_PASSWORD: ${ANALYTICS_READER_PASSWORD:?set ANALYTICS_READER_PASSWORD in .env}
ports:
- 127.0.0.1:${POSTGRES_PORT:-5434}:5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
# TCP only accepts connections once the first-start import has finished.
test:
- CMD-SHELL
- PGPASSWORD="$$ANALYTICS_READER_PASSWORD" psql -h localhost -U analytics_reader -d adventureworks -c "SELECT 1 FROM analytics.agent_view_products LIMIT 1"
interval: 5s
retries: 60
dotnet-api:
profiles: [dotnet]
build: backends/dotnet
environment:
ConnectionStrings__Analytics: Server=sqlserver;Database=AdventureWorksDW;User Id=AnalyticsReader;Password=${ANALYTICS_READER_PASSWORD};TrustServerCertificate=True
DATA_SCOPE: ${DATA_SCOPE:-*}
# MODEL and the provider's API key, see agent/.env.example. Without agent/.env: the demo model.
env_file:
- agent/demo.env
- path: agent/.env
required: false
ports:
- 127.0.0.1:8081:8080
networks:
default:
aliases: [data-api]
depends_on:
sqlserver:
condition: service_healthy
node-api:
profiles: [node]
build: backends/node
environment:
DATABASE_URL: postgres://analytics_reader:${ANALYTICS_READER_PASSWORD}@postgres:5432/adventureworks
DATA_SCOPE: ${DATA_SCOPE:-*}
# MODEL and the provider's API key, see agent/.env.example. Without agent/.env: the demo model.
env_file:
- agent/demo.env
- path: agent/.env
required: false
ports:
- 127.0.0.1:8082:8080
networks:
default:
aliases: [data-api]
depends_on:
postgres:
condition: service_healthy
agent:
profiles: [agent]
build: agent
# MODEL and the provider's API key, see agent/.env.example. Without agent/.env: the demo model.
env_file:
- agent/demo.env
- path: agent/.env
required: false
environment:
DATA_API_URL: http://data-api:8080
ports:
- 127.0.0.1:4111:4111
# A stand-in for an LLM provider, so the demo runs without an API key: no language model, only
# keyword matching, and every answer says so. See agent/demo.env.
demo-model:
profiles: [dotnet, node, agent]
build: demo-model
web:
profiles: [dotnet, node]
build: frontend
environment:
# Where /agent goes: the backend by default, the separate agent service with --profile agent.
AGENT_URL: ${AGENT_URL:-http://data-api:8080}
ports:
- 127.0.0.1:${WEB_PORT:-8080}:80
volumes:
sqlserver-data:
postgres-data: