-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
120 lines (111 loc) · 3.72 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
114
115
116
117
118
119
120
version: "2.12"
services:
rabbitmq:
# Use built image by official redis
image: "rabbitmq:3.9.24-alpine"
container_name: myrabbitmq
# redis default port open to 5672 for local network ip address access
ports:
- "5672:5672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 15s
timeout: 10s
retries: 5
networks:
- backend
redis:
# Use built image by official redis
image: "redis:7.0.5-alpine3.16"
container_name: myredis
# redis default port open to 6379 for local network ip address access
ports:
- "6379:6379"
networks:
- backend
vue:
# Build by yourself after changing `./vue/app/Dockerfile`, or use built image on my dockerhub
# image: "mrxir/rec2vqa:vue"
build:
context: "./vue/app/"
args:
- NODE_ENV=development
# Use 80 convenient port for vue app access through local network ip
ports:
- "80:8080"
- "9229:9229"
- "9230:9230"
volumes:
- ./vue/app:/opt/node_app/app
# bind-mounting these two files in will let you add packages during development without rebuilding
# for example, to add bower to your app while developing, just install it inside the container
# and then nodemon will restart. Your changes will last until you "docker compose down" and will
# be saved on host for next build.
# remember to isntall from the parent directory to the code bind-mount:
# docker compose exec -w /opt/node_app node npm install --save bower
- ./vue/app/package.json:/opt/node_app/package.json
- ./vue/app/package-lock.json:/opt/node_app/package-lock.json
# this is a workaround to prevent host node_modules from accidently getting mounted in container
# in case you want to use node/npm both outside container for test/lint etc. and also inside container
# this will overwrite the default node_modules dir in container so it won't conflict with our
# /opt/node_app/node_modules location. Thanks to PR from @brnluiz
- notused:/opt/node_app/app/node_modules
django:
# Build by yourself after changing `./django/Dockerfile`, or use built image on my dockerhub
# image: "mrxir/rec2vqa:django"
build: "./django"
# Use 8080 default django port for local network ip address access
ports:
- "8080:8080"
volumes:
- ./django:/work
depends_on:
- "redis"
networks:
- backend
vlbert-recworker:
# Build by yourself after changing `./vlbert/Dockerfile`, or use built image on my dockerhub
# build: "./vlbert/"
image: "mrxir/rec2vqa:vlbert"
volumes:
- type: bind
source: ./
target: /work
# nvidia-docker gpu support for all devices
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# Run vlbert runtime cuda build installation, and then run rec worker program
command: bash -c "cd ./django && python -u recworker.py"
depends_on:
rabbitmq:
condition: service_healthy
networks:
- backend
vlbert-vqaworker:
# Build by yourself after changing `./vlbert/Dockerfile`, or use built image on my dockerhub
# build: "./vlbert/"
image: "mrxir/rec2vqa:vlbert"
volumes:
- type: bind
source: ./
target: /work
# nvidia-docker gpu support for all devices
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# Run vlbert runtime cuda build installation, and then run vqa worker program
command: bash -c "cd ./django && python -u vqaworker.py"
depends_on:
rabbitmq:
condition: service_healthy
networks:
- backend
volumes:
notused:
networks:
backend: