-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yaml
131 lines (117 loc) · 2.54 KB
/
docker-compose.yaml
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
121
122
123
124
125
126
127
128
129
130
version: '2'
services:
dev: &dev
build:
context: .
dockerfile: Dockerfile.dev
privileged: true
volumes:
- ".:/go/src/github.com/luizbafilho/fusis/"
- "/lib/modules:/lib/modules"
depends_on:
- etcd
working_dir: /go/src/github.com/luizbafilho/fusis/
command: sh -c "go build -o bin/fusis && bin/fusis balancer"
ports:
- 8000:8000
networks:
- default
- vips
full:
<<: *dev
depends_on:
- etcd
- bird
- real
- real2
bird:
build:
context: .
dockerfile: Dockerfile.bird
privileged: true
volumes:
- "./bird.conf:/etc/bird/bird.conf"
- bird-volume:/var/run/bird.ctl
networks:
default:
ipv4_address: 172.100.0.20
etcd:
environment:
ETCDCTL_API: 3
ETCD_DEBUG: "true"
image: quay.io/coreos/etcd:v3.2.7
command:
/usr/local/bin/etcd
--name docker-compose
--listen-client-urls http://0.0.0.0:2379
--advertise-client-urls http://0.0.0.0:2379
--listen-peer-urls http://0.0.0.0:2380
--initial-advertise-peer-urls http://0.0.0.0:2380
--initial-cluster docker-compose=http://0.0.0.0:2380
--initial-cluster-token my-etcd-token
--initial-cluster-state new
networks:
default:
ipv4_address: 172.100.0.40
real:
image: nginx:1.13
networks:
default:
ipv4_address: 172.100.0.50
real2:
image: nginx:1.13
networks:
default:
ipv4_address: 172.100.0.60
client:
image: tutum/curl
networks:
networks:
default:
ipv4_address: 172.100.0.100
vips: {}
test: &test
build:
context: .
dockerfile: Dockerfile.dev
privileged: true
environment:
ETCD_ENDPOINTS: 172.100.0.40:2379
volumes:
- ".:/go/src/github.com/luizbafilho/fusis/"
- "/lib/modules:/lib/modules"
working_dir: /go/src/github.com/luizbafilho/fusis/
depends_on:
- etcd
command: go test -race ./...
ci:
<<: *test
command: ./covertests.sh
e2e:
build:
context: .
dockerfile: Dockerfile.e2e
command: /app/e2e/run.sh
volumes:
- ".:/app"
- bird-volume:/var/run/bird.ctl
depends_on:
- full
networks:
- default
- vips
volumes:
bird-volume:
networks:
vips:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.100.0.0/24
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.100.0.0/24