This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
138 lines (131 loc) · 3.53 KB
/
docker-compose.yml
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
name: quack
version: '3.8'
services:
db:
image: postgres:15-alpine
expose:
- 5432
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data/
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"]
interval: 10s
timeout: 3s
retries: 3
ollama:
image: ollama/ollama:0.2.1
expose:
- 11434
volumes:
- "$HOME/.ollama:/root/.ollama"
command: serve
healthcheck:
test: ["CMD-SHELL", "ollama --help"]
interval: 10s
timeout: 5s
retries: 3
backend:
image: quackai/companion:latest
build:
context: .
dockerfile: ./src/Dockerfile
depends_on:
db:
condition: service_healthy
ollama:
condition: service_healthy
ports:
- "5050:5050"
environment:
- SUPERADMIN_GH_PAT=${SUPERADMIN_GH_PAT}
- GH_OAUTH_ID=${GH_OAUTH_ID}
- GH_OAUTH_SECRET=${GH_OAUTH_SECRET}
- POSTGRES_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
- SUPERADMIN_LOGIN=${SUPERADMIN_LOGIN}
- SUPERADMIN_PWD=${SUPERADMIN_PWD}
- JWT_SECRET=${JWT_SECRET}
- LLM_PROVIDER=${LLM_PROVIDER:-ollama}
- OLLAMA_ENDPOINT=http://ollama:11434
- OLLAMA_MODEL=${OLLAMA_MODEL}
- GROQ_API_KEY=${GROQ_API_KEY}
- GROQ_MODEL=${GROQ_MODEL}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_MODEL=${OPENAI_MODEL}
- OLLAMA_TIMEOUT=${OLLAMA_TIMEOUT:-60}
- SUPPORT_EMAIL=${SUPPORT_EMAIL}
- DEBUG=true
- PROMETHEUS_ENABLED=true
volumes:
- ./src/:/app/
command: >
sh -c "alembic upgrade head
&& python app/db.py
&& curl -X POST http://ollama:11434/api/pull -d '{\"name\": \"${OLLAMA_MODEL}\"}'
&& uvicorn app.main:app --reload --host 0.0.0.0 --port 5050 --proxy-headers"
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:5050/status"]
interval: 10s
timeout: 3s
retries: 5
gradio:
image: quackai/gradio:latest
build:
context: .
dockerfile: ./demo/Dockerfile
depends_on:
backend:
condition: service_healthy
ports:
- 7860:7860
environment:
- API_URL=http://backend:5050/api/v1
- SUPERADMIN_LOGIN=${SUPERADMIN_LOGIN}
- SUPERADMIN_PWD=${SUPERADMIN_PWD}
volumes:
- ./demo/:/app/
command: python main.py --server-name 0.0.0.0
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:7860"]
interval: 10s
timeout: 3s
retries: 3
prometheus:
image: prom/prometheus:latest
depends_on:
backend:
condition: service_healthy
expose:
- 9090
volumes:
- ./apm/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
healthcheck:
test: ["CMD-SHELL", "nc -vz localhost 9090"]
interval: 10s
timeout: 3s
retries: 3
grafana:
image: grafana/grafana:latest
depends_on:
prometheus:
condition: service_healthy
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_USER=${GF_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PWD}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./apm/grafana:/etc/grafana/provisioning
healthcheck:
test: ["CMD-SHELL", "nc -vz localhost 3000"]
interval: 10s
timeout: 3s
retries: 3
volumes:
postgres_data: