-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose-app-with-envoy.yml
57 lines (54 loc) · 1.86 KB
/
docker-compose-app-with-envoy.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
version: '3'
services:
myapplication_behind_envoy:
image: tak2siva/tiny-mock-server
environment:
PORT: 8123
CONTENT: 'this is app--ONE-- via envoy'
CODE: 200
networks:
- xds-application
deploy:
replicas: 2
update_config:
delay: 60s
parallelism: 1
myapplication:
image: envoyproxy/envoy:v1.7.0
volumes:
- $PWD/envoy-config.yaml:/envoy-config.yaml
command: ["envoy", "-c", "/envoy-config.yaml", "--v2-config-only", "-l", "info"]
# depends_on:
# - xds-server
networks:
- infra_xds-infra
- xds-application
ports:
- "8123:8123"
- "9901:9901"
deploy:
replicas: 1
## Import Consul KV Pairs
consul-import:
image: consul:latest
restart: on-failure
networks:
- infra_xds-infra
volumes:
- $PWD/config/initialise/cluster-config.json:/cluster-config.json
- $PWD/config/initialise/cluster-version.json:/cluster-version.json
- $PWD/config/initialise/listener-config.json:/listener-config.json
- $PWD/config/initialise/listener-version.json:/listener-version.json
- $PWD/wait-for-command.sh:/scripts/wait-for-command.sh
command: >
sh -c 'chmod +x /scripts/wait-for-command.sh; sh /scripts/wait-for-command.sh -t 30 -c "curl -f http://consul-server-bootstrap:8500/v1/status/leader"
&& export CONSUL_HTTP_ADDR=consul-server-bootstrap:8500
&& consul kv put xDS/app-cluster/myapplication-cluster/CDS/config @cluster-config.json
&& consul kv put xDS/app-cluster/myapplication-cluster/CDS/version @cluster-version.json
&& consul kv put xDS/app-cluster/myapplication-cluster/LDS/config @listener-config.json
&& consul kv put xDS/app-cluster/myapplication-cluster/LDS/version @listener-version.json'
networks:
infra_xds-infra:
external: true
xds-application:
external: false