-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (85 loc) · 2.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
89 lines (85 loc) · 2.38 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
name: codemind
services:
mysql:
image: mysql:8.0
container_name: codemind-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD:-codemind_password}
MYSQL_DATABASE: ${MYSQL_DATABASE:-codemind}
TZ: Asia/Shanghai
ports:
- "127.0.0.1:${MYSQL_HOST_PORT:-3306}:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./database/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$${MYSQL_ROOT_PASSWORD} --silent"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: codemind-backend:latest
container_name: codemind-backend
restart: unless-stopped
env_file:
- ./backend/.env
environment:
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_USER: root
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-codemind_password}
MYSQL_DATABASE: ${MYSQL_DATABASE:-codemind}
UPLOAD_DIR: /data/uploads
CHROMA_PERSIST_DIR: /data/chroma
BACKEND_CORS_ORIGINS: http://localhost:5173,http://127.0.0.1:5173,http://localhost:8080,http://127.0.0.1:8080
LOGIN_RATE_LIMIT_TRUST_PROXY: "true"
ports:
- "127.0.0.1:${BACKEND_HOST_PORT:-8000}:8000"
volumes:
- backend_uploads:/data/uploads
- chroma_data:/data/chroma
depends_on:
mysql:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health/ready', timeout=3).read()",
]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: codemind-frontend:latest
container_name: codemind-frontend
restart: unless-stopped
ports:
- "${FRONTEND_HOST_PORT:-8080}:80"
depends_on:
backend:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 10s
volumes:
mysql_data:
backend_uploads:
chroma_data: