-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (62 loc) · 1.55 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
version: '3'
services:
redis_master_service:
image: redis:4.0.11-alpine3.8
volumes:
- ~/redis_data:/data
sysctls:
net.core.somaxconn: 5000
redis_slave_service:
image: redis:4.0.11-alpine3.8
volumes:
- ~/redis_data:/data
command: redis-server --slaveof redis-master 6379
sysctls:
net.core.somaxconn: 5000
links:
- redis_master_service:redis-master
redis_sentinel_service:
build: ./redis-sentinel
environment:
- SENTINEL_DOWN_AFTER=5000
- SENTINEL_FAILOVER=5000
- SENTINEL_MASTER_NAME=malware_detector_redis_master
sysctls:
net.core.somaxconn: 5000
links:
- redis_master_service:redis-master
- redis_slave_service
url_service:
build: ./detector
deploy:
replicas: 3
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
environment:
- SENTINEL_MASTER_NAME=malware_detector_redis_master
- SENTINEL_PREFIX=malware_url_detector_redis_sentinel_service
- SENTINEL_PORT=26379
labels:
- "traefik.backend=url_service"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:localhost"
- "traefik.port=8008"
depends_on:
- redis_sentinel_service
proxy_service:
image: traefik:v1.7.0-rc5-alpine
command: --api --docker
depends_on:
- url_service
environment:
- BALANCE=leastconn
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
- "8080:8080"
deploy:
restart_policy:
condition: on-failure