-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
211 lines (195 loc) · 5.14 KB
/
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
configs:
squid:
file: ./test/resources/proxy/squid.conf
squid-basic-auth:
file: ./test/resources/proxy/squid-basic-auth.conf
squid-https-inspection:
file: ./test/resources/proxy/squid-https-inspection.conf
pac-file:
file: ./test/resources/proxy/proxy.pac
services:
proxy: &proxy
profiles: [test]
build:
context: .
dockerfile: Dockerfile
target: hck-fetch-test-proxy
init: true
entrypoint: /apps/squid/sbin/squid
command: -N -f /etc/squid/squid.conf
ports:
- 3128:3128
environment:
- HEALTH_CHECK_PROXY_URL=localhost:3128
configs:
- source: squid
target: /etc/squid/squid.conf
healthcheck:
test: ['CMD', 'sh', '-exec', 'curl -sSL --insecure --fail -x $${HEALTH_CHECK_PROXY_URL} https://hackolade.com']
interval: 60s
timeout: 2s
retries: 5
start_period: 5s
proxy-basic-auth:
<<: *proxy
ports:
- 3129:3128
environment:
- HEALTH_CHECK_PROXY_URL=http://user1:user1@localhost:3128
configs:
- source: squid-basic-auth
target: /etc/squid/squid.conf
proxy-https-inspection:
<<: *proxy
ports:
- 3130:3128
configs:
- source: squid-https-inspection
target: /etc/squid/squid.conf
nginx:
image: nginx:stable
ports:
- 8081:80
configs:
- source: pac-file
target: /usr/share/nginx/html/proxy.pac
healthcheck:
test: ['CMD', 'sh', '-exec', 'curl -sSL --fail http://localhost/proxy.pac']
interval: 2s
timeout: 2s
retries: 5
start_period: 1s
server:
profiles: [test]
build:
context: .
dockerfile: Dockerfile
target: hck-fetch-test-server
init: true
ports:
- 8080:8080
- 4443:4443
healthcheck:
test: ['CMD', 'sh', '-exec', 'curl -sSL --fail localhost:8080/status']
interval: 60s
timeout: 2s
retries: 5
start_period: 5s
depends_on:
proxy:
condition: service_healthy
proxy-basic-auth:
condition: service_healthy
proxy-https-inspection:
condition: service_healthy
nginx:
condition: service_healthy
app: &app
profiles: [template]
build:
context: .
dockerfile: Dockerfile
target: hck-fetch-test-app
init: true
network_mode: host
healthcheck:
test: ['CMD', 'sh', '-exec', 'curl -sSL --fail localhost:$${PORT}/status']
interval: 60s
timeout: 2s
retries: 5
start_period: 5s
depends_on:
server:
condition: service_healthy
app-direct:
<<: *app
profiles: [test]
environment:
- PORT=3001
- SERVER_API_URL=http://localhost:8080/initiators/direct
app-self-signed-cert:
<<: *app
profiles: [test]
environment:
- PORT=3002
- SERVER_API_URL=https://localhost:4443/initiators/cert
app-proxy:
<<: *app
profiles: [test]
environment:
- PORT=3003
- SERVER_API_URL=http://server:8080/initiators/proxy
- HTTP_PROXY=http://localhost:3128
- HTTPS_PROXY=http://localhost:3128
app-proxy-basic-auth:
<<: *app
profiles: [test]
environment:
- PORT=3004
- SERVER_API_URL=http://server:8080/initiators/proxy-basic-auth
- HTTP_PROXY=http://user1:user1@localhost:3129
- HTTPS_PROXY=http://user1:user1@localhost:3129
app-proxy-https-inspection:
<<: *app
profiles: [test]
environment:
- PORT=3005
- SERVER_API_URL=https://server:4443/initiators/proxy-https-inspection
- HTTP_PROXY=http://localhost:3130
- HTTPS_PROXY=http://localhost:3130
app-custom-self-signed-cert:
<<: *app
profiles: [test]
environment:
- PORT=3006
- SERVER_API_URL=https://localhost:4443/initiators/custom-cert
- CUSTOM_CA=OK
app-custom-proxy:
<<: *app
profiles: [test]
environment:
- PORT=3007
- SERVER_API_URL=http://server:8080/initiators/custom-proxy
- CUSTOM_PROXY_RULES=localhost:3128
app-custom-proxy-basic-auth:
<<: *app
profiles: [test]
environment:
- PORT=3008
- SERVER_API_URL=http://server:8080/initiators/custom-proxy-basic-auth
- CUSTOM_PROXY_RULES=localhost:3129
app-custom-proxy-pac-file:
<<: *app
profiles: [test]
environment:
- PORT=3009
- SERVER_API_URL=http://server:8080/initiators/custom-proxy-pac-file
- CUSTOM_PROXY_PAC_SCRIPT=http://127.0.0.1:8081/proxy.pac
tests:
profiles: [test]
build:
context: .
dockerfile: Dockerfile
target: hck-fetch-tests
init: true
network_mode: host
tty: true
depends_on:
app-direct:
condition: service_healthy
app-self-signed-cert:
condition: service_healthy
app-proxy:
condition: service_healthy
app-proxy-basic-auth:
condition: service_healthy
app-proxy-https-inspection:
condition: service_healthy
app-custom-self-signed-cert:
condition: service_healthy
app-custom-proxy:
condition: service_healthy
app-custom-proxy-basic-auth:
condition: service_healthy
app-custom-proxy-pac-file:
condition: service_healthy