-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (31 loc) · 1.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
32 lines (31 loc) · 1.11 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
version: '3.8'
services:
media-render:
container_name: media-render-service
build:
context: .
dockerfile: Dockerfile
ports:
- "3005:3005"
restart: unless-stopped
environment:
- PORT=3005
- CONCURRENT_RENDER_LIMIT=2
# Đặt 85% cho môi trường production trong Docker để phòng tránh cạn kiệt RAM của máy chủ/container
- MAX_MEMORY_USAGE_PERCENT=85
- MAX_PROCESS_MEMORY_MB=1536
- MAX_CPU_LOAD_RATIO=0.9
volumes:
# Mount file cấu hình môi trường
- ./.env:/app/.env
# Mount thư mục đầu ra để lấy video đã render về máy host hoặc chia sẻ với NestJS backend
- ./test-outputs:/app/test-outputs
# Mount thư mục asset cục bộ để chạy các bài test offline
- ./test-assets:/app/test-assets
healthcheck:
# Sử dụng endpoint /health tích hợp sẵn để kiểm tra trạng thái tài nguyên container
test: ["CMD-SHELL", "curl -f http://localhost:3005/health || exit 1"]
interval: 15s
timeout: 5s
retries: 3
start_period: 5s