-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
113 lines (92 loc) · 2.65 KB
/
docker-compose.yml
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
version: "3.9"
services:
project:
container_name: ${PROJECT}_${USER_NAME}
runtime: nvidia
build:
context: docker/
dockerfile: Dockerfile
args:
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
image: ${PROJECT}:${USER_NAME}
environment:
- TZ=Asia/Shanghai
- TORCH_HOME=/data/torch_model
- TRANSFORMERS_CACHE=/data/pretrain/transformers
- CLIP_CACHE=/data/pretrain/clip
hostname: docker
ipc: host
# directly mapping ports in container to host
network_mode: host
working_dir: /project
command:
[
"/bin/bash",
"-c",
"/bin/rsync -avP /${USER_NAME}_home_bak/ /home/${USER_NAME} --ignore-existing && . /home/${USER_NAME}/.bashrc && sleep infinity",
]
# mount the <directory in host> to the <directory in container>
# add more mounts here if you need
volumes:
- /var/run/docker.sock:/var/run/docker.sock # run docker in docker
- ${CODE_ROOT}:/project
- ${DATA_ROOT}:/data
- ${LOG_ROOT}:/log
- type: bind
source: ${CONTAINER_HOME}
target: /home/${USER_NAME}
blender:
container_name: ${PROJECT}_${USER_NAME}_blender
runtime: nvidia
build:
context: trance/
dockerfile: Dockerfile
args:
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
image: ${PROJECT}_blender:${USER_NAME}
environment:
- TZ=Asia/Shanghai
hostname: docker
ipc: host
# directly mapping ports in container to host
network_mode: host
working_dir: /project
command: ["sleep", "infinity"]
# mount the <directory in host> to the <directory in container>
# add more mounts here if you need
volumes:
- ${CODE_ROOT}/trance:/project
- ${DATA_ROOT}:/data
- ${LOG_ROOT}:/log
demo:
container_name: ${PROJECT}_${USER_NAME}_demo
build:
context: docker/
dockerfile: Dockerfile.node
args:
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
image: ${PROJECT}_demo:${USER_NAME}
environment:
- TZ=Asia/Shanghai
hostname: docker
ipc: host
# directly mapping ports in container to host
network_mode: host
working_dir: /project
# if you locate in China, you can use taobao mirror to speed up
command:
[
"bash",
"-c",
"npm config set registry https://registry.npm.taobao.org && yarn && yarn dev --host",
]
# else you can use the default npm registry
# command: ["bash", "-c", "yarn && yarn dev --host"]
volumes:
- ${CODE_ROOT}/src/demo/ui:/project