-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
119 lines (110 loc) · 3.33 KB
/
docker-compose.gpu.yml
File metadata and controls
119 lines (110 loc) · 3.33 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
114
115
116
117
118
119
services:
backend:
build:
context: .
dockerfile: Dockerfile.backend # CUDA image
image: llmaix-backend:gpu
env_file: .env
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- DISABLE_CELERY=false
- INITIALIZE_CELERY=false
- REQUIRE_INVITATION=false
ports: ["8000:8000"]
volumes:
- ./backend:/app/backend
- .env:/app/backend/.env
deploy: # ← GPU reservation
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
depends_on: [postgres, redis, minio]
worker_default:
image: llmaix-backend:gpu
env_file: .env
command: >
celery -A backend.src.celery.celery_config
worker -Q default -c 4 --loglevel=info
volumes:
- ./backend:/app/backend
- .env:/app/backend/.env
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
depends_on: [backend]
worker_preprocess:
image: llmaix-backend:gpu
env_file: .env
command: >
celery -A backend.src.celery.celery_config
worker -Q preprocess -c 1 --loglevel=info
volumes:
- ./backend:/app/backend
- .env:/app/backend/.env
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
depends_on: [backend]
# ─────────── Vue / Vite front‑end ───────────
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
args:
- VITE_API_BACKEND_URL=${VITE_API_BACKEND_URL}
image: llmaix-frontend:latest
env_file: .env
ports: ["5173:80"] # http://localhost:5173
depends_on: [backend]
# ─────────── PostgreSQL ───────────
postgres:
image: postgres:16-alpine
env_file: .env # supplies user/pass/db
volumes:
- pgdata:/var/lib/postgresql/data
# ─────────── Redis (Celery broker) ───────────
redis:
image: redis:7-alpine
ports: ["6379:6379"]
volumes:
- redis-data:/data
# ─────────── MinIO (S3‑compatible) ───────────
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
env_file: .env
# ports:
# - "9000:9000" # S3 API
# - "9001:9001" # Web console
volumes:
- minio-data:/data
# ─────────── one‑shot bucket creator ───────────
minio-init:
image: minio/mc # MinIO CLI
depends_on: [ minio ]
env_file: .env # <- brings in MINIO_* and S3_BUCKET_NAME
entrypoint: >
/bin/sh -c "
# wait until MinIO is reachable
until mc alias set local http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}; do
sleep 3;
done;
# create bucket if it doesn’t already exist
mc mb -p local/${S3_BUCKET_NAME} || true;
# (optional) make it publicly readable
mc policy set download local/${S3_BUCKET_NAME};
echo '✅ Bucket '${S3_BUCKET_NAME}' ready';
"
restart: "no"
volumes:
pgdata:
redis-data:
minio-data: