-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (68 loc) · 1.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (68 loc) · 1.63 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
services:
# MySQL/
db:
image: mysql:8.0
container_name: courselink_mysql
restart: unless-stopped
ports:
- "3307:3306"
environment:
# “”
MYSQL_ROOT_PASSWORD: your_mysql_root_password_here
MYSQL_DATABASE: chatbot
MYSQL_USER: backend_user
MYSQL_PASSWORD: your_strong_password_here
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# Django Django + DRF + LangGraph Agent
backend:
build: ./backend
container_name: courselink_backend
restart: unless-stopped
env_file:
- ./backend/.env
environment:
# HF
HF_HOME: /app/models
# 1= models/
TRANSFORMERS_OFFLINE: "0"
volumes:
- ./models:/app/models:ro
# Nginx static/media
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
command:
- sh
- -c
- |
python manage.py migrate &&
python manage.py collectstatic --noinput &&
uvicorn backend.asgi:application --host 0.0.0.0 --port 8000 --workers 1
# Nginx + UI
nginx:
build: ./nginx
container_name: courselink_nginx
restart: unless-stopped
ports:
- "80:80"
volumes:
- static_volume:/app/staticfiles:ro
- media_volume:/app/mediafiles:ro
depends_on:
backend:
condition: service_started
volumes:
db_data:
static_volume:
media_volume: