-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (103 loc) · 3.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
109 lines (103 loc) · 3.13 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
services:
postgres:
image: postgres:16-alpine
container_name: agentflow-postgres
environment:
POSTGRES_USER: agentflow
POSTGRES_PASSWORD: agentflow
POSTGRES_DB: agentflow
ports:
- "5432:5432"
volumes:
- agentflow_pg:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U agentflow"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: agentflow-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
worker:
build: ./backend
container_name: agentflow-worker
command: ["uv", "run", "python", "-m", "app.worker"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
AGENTFLOW_DATABASE_URL: postgresql+asyncpg://agentflow:agentflow@postgres:5432/agentflow
AGENTFLOW_REDIS_URL: redis://redis:6379/0
AGENTFLOW_WORKER_MODE: queue
AGENTFLOW_LOG_LEVEL: INFO
AGENTFLOW_OTEL_ENABLED: ${AGENTFLOW_OTEL_ENABLED:-false}
AGENTFLOW_OTEL_EXPORTER_ENDPOINT: ${AGENTFLOW_OTEL_EXPORTER_ENDPOINT:-http://otel-collector:4318}
AGENTFLOW_OTEL_SERVICE_NAME: agentflow-worker
profiles:
- app
otel-collector:
image: otel/opentelemetry-collector-contrib:0.96.0
container_name: agentflow-otel
command: ["--config=/etc/otelcol/config.yaml"]
volumes:
- ./docker/otel-collector.yaml:/etc/otelcol/config.yaml:ro
ports:
- "4318:4318"
- "8889:8889"
profiles:
- observability
prometheus:
image: prom/prometheus:v2.51.0
container_name: agentflow-prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./docker/prometheus/alerts.yml:/etc/prometheus/alerts.yml:ro
ports:
- "9090:9090"
depends_on:
- otel-collector
profiles:
- observability
api:
build: ./backend-java
container_name: agentflow-api
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
AGENTFLOW_DATABASE_URL: jdbc:postgresql://postgres:5432/agentflow
AGENTFLOW_DATABASE_USERNAME: agentflow
AGENTFLOW_DATABASE_PASSWORD: agentflow
AGENTFLOW_REDIS_HOST: redis
AGENTFLOW_REDIS_PORT: "6379"
AGENTFLOW_SERVER_PORT: "8000"
AGENTFLOW_OTEL_ENABLED: ${AGENTFLOW_OTEL_ENABLED:-false}
AGENTFLOW_OTEL_EXPORTER_ENDPOINT: ${AGENTFLOW_OTEL_EXPORTER_ENDPOINT:-http://otel-collector:4318/v1/traces}
AGENTFLOW_OTEL_METRICS_ENDPOINT: ${AGENTFLOW_OTEL_METRICS_ENDPOINT:-http://otel-collector:4318/v1/metrics}
AGENTFLOW_OTEL_SERVICE_NAME: agentflow-api
ports:
- "8000:8000"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8000/v1/health >/dev/null || exit 1"]
interval: 5s
timeout: 5s
retries: 24
start_period: 45s
profiles:
- app
volumes:
agentflow_pg: