forked from datajoint/element-deeplabcut
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
76 lines (70 loc) · 2.15 KB
/
docker-compose.yaml
File metadata and controls
76 lines (70 loc) · 2.15 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
# Docker Compose configuration for element-deeplabcut client environment
# Usage: docker compose up --build
# docker compose run client python your_script.py
version: "3.8"
services:
# MySQL database service
db:
restart: always
image: datajoint/mysql:${MYSQL_VER:-8.0}
environment:
- MYSQL_ROOT_PASSWORD=${DJ_PASS:-datajoint}
ports:
- "${DB_PORT:-3306}:3306"
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DJ_PASS:-datajoint}"]
timeout: 15s
retries: 10
interval: 15s
networks:
- element_network
# Client container
client:
build:
context: .
dockerfile: Dockerfile
depends_on:
db:
condition: service_healthy
environment:
- DJ_HOST=db
- DJ_USER=root
- DJ_PASS=${DJ_PASS:-datajoint}
- DJ_PORT=3306
- DATABASE_PREFIX=${DATABASE_PREFIX:-}
- DLC_ROOT_DATA_DIR=${DLC_ROOT_DATA_DIR:-/app/test_videos}
- PYTHONUNBUFFERED=1
# GPU support - set NVIDIA_VISIBLE_DEVICES to enable GPU access
# Can be overridden via -e flag in docker compose run
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
volumes:
# Mount data directory (can be customized via DLC_DATA_DIR env var)
# Default: ./test_videos (for tests) or ./data (for general use)
- ${DLC_DATA_DIR:-./test_videos}:/app/data
# Mount config file if it exists
- ./dj_local_conf.json:/app/dj_local_conf.json:ro
# Mount the project directory for development
- .:/app
networks:
- element_network
# GPU support for docker compose v2
# This requires nvidia-container-toolkit to be installed on the host
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
# Default command - interactive bash (entrypoint is /bin/bash)
# Example: docker compose run client -c "python test_model_train_run.py"
command: ["-i"]
stdin_open: true
tty: true
volumes:
db_data:
networks:
element_network:
driver: bridge