-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (123 loc) · 3.05 KB
/
docker-compose.yml
File metadata and controls
132 lines (123 loc) · 3.05 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
120
121
122
123
124
125
126
127
128
129
130
131
132
version: "3.8"
services:
# Development service
videoannotator-dev:
build:
context: .
dockerfile: Dockerfile.cpu
volumes:
- .:/app
- ./data:/app/data
- ./output:/app/output
environment:
- PYTHONPATH=/app
- CUDA_VISIBLE_DEVICES=0
ports:
- "8888:8888" # Jupyter
- "18011:18011" # FastAPI (host 18011 -> container 18011)
command: ["uv", "run", "videoannotator", "--help"]
profiles:
- dev
# Production service
videoannotator-prod:
build:
context: .
dockerfile: Dockerfile.cpu
volumes:
- ./data:/app/data:ro
- ./output:/app/output
environment:
- PYTHONPATH=/app
command: ["uv", "run", "videoannotator", "server", "--host", "0.0.0.0", "--port", "18011"]
profiles:
- prod
# GPU-enabled service
videoannotator-gpu:
build:
context: .
dockerfile: Dockerfile.gpu
volumes:
- ./data:/app/data:ro
- ./output:/app/output
environment:
- PYTHONPATH=/app
- CUDA_VISIBLE_DEVICES=0
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
command: ["uv", "run", "videoannotator", "server", "--host", "0.0.0.0", "--port", "18011"]
profiles:
- gpu
# Development service with GPU and pre-cached models
videoannotator-dev-gpu:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- ./data:/app/data
- ./output:/app/output
- ./logs:/app/logs
- ./database:/app/database # Persistent database for development
environment:
- PYTHONPATH=/app
- CUDA_VISIBLE_DEVICES=0
- VIDEOANNOTATOR_DB_PATH=/app/database/videoannotator_dev.db
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
ports:
- "18011:18011" # FastAPI server (host 18011)
command: ["uv", "run", "videoannotator", "server", "--host", "0.0.0.0", "--port", "18011"]
profiles:
- dev-gpu
# Jupyter service for development
jupyter:
build:
context: .
dockerfile: Dockerfile.cpu
volumes:
- .:/app
- ./data:/app/data
- ./output:/app/output
ports:
- "8888:8888"
environment:
- PYTHONPATH=/app
command: ["bash", "-lc", "uv sync --extra dev && uv run jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root"]
profiles:
- dev
# Database service (optional, for future use)
postgres:
image: postgres:13
environment:
- POSTGRES_DB=videoannotator
- POSTGRES_USER=videoannotator
- POSTGRES_PASSWORD=videoannotator
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
profiles:
- db
# Redis service (optional, for caching)
redis:
image: redis:7
ports:
- "6379:6379"
profiles:
- cache
volumes:
postgres_data:
networks:
default:
name: videoannotator_network