Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (73 loc) · 2.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (73 loc) · 2.44 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
71
72
73
74
services:
asyncdb-1:
# One image between the three nodes: a service that names a build of its own is another
# concurrent build of this same Dockerfile, blind to the layers the others are committing.
# The localhost/ prefix is what tells podman-compose the image is built here, not pulled.
build: .
image: localhost/asyncdb
container_name: asyncdb-1
environment:
# Where etcd answers, and this node as the other nodes reach it. Nodes talk to the API port
# directly rather than through the nginx the browser uses.
- ASYNCDB_ETCD=http://etcd:2379
- ASYNCDB_NODE=http://asyncdb-1:8080
# Every zone holds a copy of every record. Two zones here rather than three, so that this is
# a cluster which both partitions — between the two nodes of zone one — and replicates: node
# three is zone two on its own, and holds every record the other two hold between them.
- ASYNCDB_ZONE=one
ports:
- 8080:80
# The store, kept across a container being recreated so that a node comes back holding what
# it wrote rather than empty.
volumes:
- asyncdb-1-data:/var/lib/asyncdb
depends_on:
- etcd
asyncdb-2:
image: localhost/asyncdb
container_name: asyncdb-2
environment:
- ASYNCDB_ETCD=http://etcd:2379
- ASYNCDB_NODE=http://asyncdb-2:8080
- ASYNCDB_ZONE=one
ports:
- 8081:80
# The store, kept across a container being recreated so that a node comes back holding what
# it wrote rather than empty.
volumes:
- asyncdb-2-data:/var/lib/asyncdb
depends_on:
- etcd
asyncdb-3:
image: localhost/asyncdb
container_name: asyncdb-3
environment:
- ASYNCDB_ETCD=http://etcd:2379
- ASYNCDB_NODE=http://asyncdb-3:8080
- ASYNCDB_ZONE=two
ports:
- 8082:80
# The store, kept across a container being recreated so that a node comes back holding what
# it wrote rather than empty.
volumes:
- asyncdb-3-data:/var/lib/asyncdb
depends_on:
- etcd
etcd:
image: quay.io/coreos/etcd:v3.5.9
container_name: etcd
environment:
- ETCD_NAME=etcd-node
- ETCD_DATA_DIR=/etcd-data
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
ports:
- 2379:2379
volumes:
- /tmp/etcd-data:/etcd-data:Z
command:
- /usr/local/bin/etcd
volumes:
asyncdb-1-data:
asyncdb-2-data:
asyncdb-3-data: