-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
150 lines (133 loc) · 4.03 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
version: "3.8"
x-mock-shared-vars: &mock-shared-vars
CHAN_HOST: http://mock-4channel:80
x-live-shared-vars: &live-shared-vars
CHAN_HOST: https://a.4cdn.org
x-shared-curl-heathcheck: &shared-curl-heathcheck
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 10s
timeout: 5s
retries: 3
services:
live-python:
build: ./python
healthcheck:
<<: *shared-curl-heathcheck
command: flask --app main run --debug --host=0.0.0.0 --port=80
ports: [8001:80]
volumes: [./python/src:/app]
environment:
<<: *live-shared-vars
mocked-python:
build: ./python
healthcheck:
<<: *shared-curl-heathcheck
command: flask --app main run --debug --host=0.0.0.0 --port=80
ports: [8011:80]
volumes: [./python/src:/app]
depends_on: [mock-4channel]
environment:
<<: *mock-shared-vars
live-go:
build:
context: ./go
target: dev
healthcheck:
<<: *shared-curl-heathcheck
command: ["CompileDaemon", "-directory=/app/", "-polling", "-build=go build -a -tags netgo -o ./service", "-command=/app/service"]
ports: [8002:80]
volumes: [./go/src:/app]
environment:
<<: *live-shared-vars
mocked-go:
build:
context: ./go
target: dev
healthcheck:
<<: *shared-curl-heathcheck
command: ["CompileDaemon", "-directory=/app/", "-polling", "-build=go build -a -tags netgo -o ./service", "-command=/app/service"]
ports: [8012:80]
volumes: [./go/src:/app]
depends_on: [mock-4channel]
environment:
<<: *mock-shared-vars
live-javascript:
build: ./javascript
healthcheck:
<<: *shared-curl-heathcheck
command: nodemon --legacy-watch src/index.js
init: true
ports: [8003:80]
volumes: [./javascript/src:/app/src]
environment:
<<: *live-shared-vars
mocked-javascript:
build: ./javascript
healthcheck:
<<: *shared-curl-heathcheck
command: nodemon --legacy-watch src/index.js
init: true
ports: [8013:80]
volumes: [./javascript/src:/app/src]
depends_on: [mock-4channel]
environment:
<<: *mock-shared-vars
mock-4channel:
build: ./docker/mock-4channel
healthcheck:
<<: *shared-curl-heathcheck
volumes: [./docker/mock-4channel:/app]
# To bind a host port for this service, comment out the deploy block first
# ports: [8051:80]
deploy:
mode: replicated
replicas: 3 # Scale to 3 replicas so the dependency doesn't bottleneck the performance test
command: nodemon --legacy-watch src/index.js
swagger-ui:
image: swaggerapi/swagger-ui
ports: [9001:8080]
environment:
URL: "http://localhost:9002/swagger.yml"
depends_on:
- schema-host
- live-python
- live-go
- live-javascript
- mocked-python
- mocked-go
- mocked-javascript
schema-host:
build: ./schema
volumes: [./schema:/app/public]
ports: [9002:80]
mock-functional-test:
build: ./tests/functional
volumes: [./tests/functional:/tests]
depends_on:
mocked-python: {condition: service_healthy}
mocked-go: {condition: service_healthy}
mocked-javascript: {condition: service_healthy}
init: true
command: ptw --poll -- -vv ./mock
environment:
GLUE_IMPLEMENTATIONS_CSV: "http://mocked-python,http://mocked-go,http://mocked-javascript"
live-functional-test:
build: ./tests/functional
volumes: [./tests/functional:/tests]
depends_on:
live-python: {condition: service_healthy}
live-go: {condition: service_healthy}
live-javascript: {condition: service_healthy}
init: true
command: ptw --poll -- -vv ./live
environment:
GLUE_IMPLEMENTATIONS_CSV: "http://live-python,http://live-go,http://live-javascript"
mock-performance-test:
build: ./tests/performance
volumes: [./tests/performance/src:/bzt-configs]
init: true
tty: true
depends_on:
mocked-python: {condition: service_healthy}
mocked-go: {condition: service_healthy}
mocked-javascript: {condition: service_healthy}