-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathcompose.distributed.yml
More file actions
70 lines (66 loc) · 1.49 KB
/
compose.distributed.yml
File metadata and controls
70 lines (66 loc) · 1.49 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
services:
# Reverse proxy
haproxy:
image: reactive-hackernews/reverse_proxy
build:
context: ./reverse_proxy
dockerfile: ./Dockerfile.distributed
ports:
- "80:80"
- "443:443"
depends_on:
www:
condition: service_healthy
skip_leader:
condition: service_healthy
# Web application
web:
image: reactive-hackernews/web_service
build: ./web_service
depends_on:
db:
condition: service_healthy
environment:
DISTRIBUTED_MODE: true
SKIP_CONTROL_URL: "http://haproxy:8081/v1"
# SQL database
db:
image: reactive-hackernews/db
build: ./db
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
# Reactive cache
skip_leader:
image: reactive-hackernews/reactive_service
build: ./reactive_service
depends_on:
db:
condition: service_healthy
environment:
SKIP_LEADER: true
skip_follower1: &follower
image: reactive-hackernews/reactive_service
build: ./reactive_service
depends_on:
skip_leader:
condition: service_healthy
environment:
SKIP_FOLLOWER: true
SKIP_RESOURCE_PREFIX: follower1
skip_follower2:
<<: *follower
environment:
SKIP_FOLLOWER: true
SKIP_RESOURCE_PREFIX: follower2
skip_follower3:
<<: *follower
environment:
SKIP_FOLLOWER: true
SKIP_RESOURCE_PREFIX: follower3
# Front-end
www:
image: reactive-hackernews/www
build: ./www
volumes:
pgdata: