-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
54 lines (51 loc) · 1.15 KB
/
docker-compose.yaml
File metadata and controls
54 lines (51 loc) · 1.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
networks:
redis_network:
driver: bridge
services:
redis:
image: redis:latest
ports:
- "6379:6379"
networks:
- redis_network
platform: linux/amd64
command: ["redis-server", "--maxmemory", "4gb", "--maxmemory-policy", "allkeys-lru"]
trainer:
build:
context: .
dockerfile: ./trainer/Dockerfile
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- TOPIC_NAME=env_data
depends_on:
- redis
volumes:
- ./trainer:/app
networks:
- redis_network
runtime: nvidia
deploy:
resources:
reservations:
devices:
- capabilities: [ gpu ]
command: >
bash -c "until nc -z redis 6379; do echo 'Waiting for Redis...'; sleep 10; done; python train.py"
actor:
build:
context: .
dockerfile: ./actor/Dockerfile
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
- trainer
volumes:
- ./actor:/app
networks:
- redis_network
scale: 2
command: >
bash -c "until nc -z redis 6379; do echo 'Waiting for Redis...'; sleep 10; done; python actor.py"