-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
113 lines (107 loc) · 2.99 KB
/
docker-compose.yaml
File metadata and controls
113 lines (107 loc) · 2.99 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
services:
registry:
build:
context: ./ui/registry
dockerfile: Dockerfile
container_name: registry
ports:
- "4321:4321"
networks:
- monitoring
restart: unless-stopped
fastrag-api:
build:
context: ./cli
dockerfile: Dockerfile
container_name: fastrag-api
ports:
- "8000:8000"
environment:
FASTRAG_CONFIG_PATH: /app/resources/config.yaml
METRICS_BEARER_TOKEN: ${METRICS_BEARER_TOKEN}
MILVUS_USER: ${MILVUS_USER}
MILVUS_PASSWORD: ${MILVUS_PASSWORD}
CHAT_API_KEY: ${CHAT_API_KEY}
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/chatbot
volumes:
- ./cli/resources:/app/resources
- ./cli/fastrag:/app/fastrag
networks:
- monitoring
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
profiles:
- api
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.enable-lifecycle"
networks:
- monitoring
restart: unless-stopped
# depends_on:
# - fastrag-api
entrypoint:
- /bin/sh
- -c
- |
echo "$${METRICS_BEARER_TOKEN}" > /etc/prometheus/bearer_token
/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles --web.enable-lifecycle
environment:
- METRICS_BEARER_TOKEN=${METRICS_BEARER_TOKEN}
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
container_name: dashboard
ports:
- "3000:3000"
environment:
- PROMETHEUS_BASE_URL=http://prometheus:9090
- PROMETHEUS_BEARER_TOKEN=${PROMETHEUS_BEARER_TOKEN}
- METRICS_USE_MOCK=${METRICS_USE_MOCK}
networks:
- monitoring
restart: unless-stopped
depends_on:
- prometheus
postgres:
image: postgres:16-alpine
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-chatbot}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- monitoring
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
monitoring:
driver: bridge
volumes:
prometheus-data:
postgres-data: