-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
60 lines (57 loc) · 1.43 KB
/
compose.yaml
File metadata and controls
60 lines (57 loc) · 1.43 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
services:
ollama:
image: ollama/ollama:latest
restart: unless-stopped
environment:
OLLAMA_MODEL: ${OLLAMA_MODEL:-gpt-oss:20b}
ports:
- "11434:11434"
volumes:
- ./ollama/ollama:/root/.ollama
- ./ollama/entrypoint.sh:/entrypoint.sh:ro
entrypoint: ["/usr/bin/bash", "/entrypoint.sh"]
db:
image: mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_DATABASE: ${MYSQL_DATABASE:-sqlagent_db}
ports:
- "3306:3306"
volumes:
- ./db/db.sql:/docker-entrypoint-initdb.d/db.sql:ro
secrets:
- db_root_password
agent:
build: .
restart: unless-stopped
environment:
OLLAMA_BASE_URL: http://ollama:11434
OLLAMA_MODEL: ${OLLAMA_MODEL:-gpt-oss:20b}
MYSQL_HOST: db
MYSQL_PORT: "3306"
MYSQL_DATABASE: ${MYSQL_DATABASE:-sqlagent_db}
MYSQL_USER: ${MYSQL_USER:-root}
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
depends_on:
- ollama
- db
ports:
- "${APP_PORT:-8000}:8000"
secrets:
- db_root_password
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health')",
]
interval: 30s
timeout: 10s
retries: 10
start_period: 45s
secrets:
db_root_password:
file: ./db/passwd.txt