-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
216 lines (202 loc) · 5.17 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
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
212
213
214
215
216
version: '3.9'
services:
localstack:
image: localstack/localstack:0.14.0
environment:
- EDGE_PORT=8080
- DATA_DIR=/tmp/localstack
- DOCKER_HOST=unix:///var/run/docker.sock
- SKIP_SSL_CERT_DOWNLOAD=1
ports:
- "8080"
labels:
- "virtual.host=*.eu-west-1.amazonaws.com *.queue.amazonaws.com *.dualstack.eu-west-1.amazonaws.com *.s3.eu-west-1.amazonaws.com *.s3.dualstack.eu-west-1.amazonaws.com *.amazonaws.com *.s3.amazonaws.test *.amazonaws.test amazonaws.test"
- "virtual.port=8080"
- "virtual.tls=internal"
volumes:
- "${LOCALSTACK_DATA_DIR-/private/tmp/localstack}:/tmp/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
healthcheck:
test: ["CMD", "awslocal", "s3", "ls"]
interval: 5s
networks:
internal: {}
default: {}
proxy-external:
image: alpine/socat
command:
- tcp-listen:8888,fork,reuseaddr
- tcp-connect:proxy:8888
ports:
- "8888:8888"
networks:
- internal
- default
proxy-external-ui:
image: alpine/socat
command:
- tcp-listen:8082,fork,reuseaddr
- tcp-connect:proxy:8082
ports:
- "8082:8082"
networks:
- internal
- default
proxy:
image: mitmproxy/mitmproxy:7.0.4
command:
- "mitmweb"
- "--ssl-insecure"
- "--web-host"
- "0.0.0.0"
- "--no-web-open-browser"
- "-p"
- "8888"
- "--web-port"
- "8082"
dns:
- 10.5.0.100
volumes:
- "mitmproxy:/home/mitmproxy/.mitmproxy/"
networks:
internal:
ipv4_address: 10.5.0.101
api-gateway:
image: caddy:2.6.1
command: caddy run --watch --config /etc/caddy/Caddyfile
dns:
- 10.5.0.100
ports:
- "80:80"
- "443:443"
volumes:
- caddy-conf:/etc/caddy:ro
- caddy-data:/data/caddy
labels:
docker-gen.target:
networks:
default: {}
internal:
ipv4_address: 10.5.0.102
dockergen:
image: nginxproxy/docker-gen:0.9.0
command: -watch /etc/docker-gen/templates/caddy.tmpl /etc/caddy/Caddyfile
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${AWS_SANDBOX_DIR-.}/caddy/Caddyfile.tmpl:/etc/docker-gen/templates/caddy.tmpl
- caddy-conf:/etc/caddy
labels:
virtual.allow_http:
networks:
- internal
db:
image: postgres:10.18-alpine
command:
- -c
- max_connections=500
environment:
POSTGRES_DB: "dummydbthatisneverused"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "secret"
ports:
- "5433:5432"
volumes:
- db-data:/var/lib/postgresql/data/
networks:
internal: {}
default: {}
rds:
image: luqasn/postgres-magicdb:v0.0.5
environment:
TARGET_USER: postgres
TARGET_PASSWORD: secret
TARGET_HOST: db:5432
TARGET_DUMMY_DB: dummydbthatisneverused
ports:
- "5432:5432"
networks:
internal:
ipv4_address: 10.5.0.103
default: {}
dns:
container_name: aws-sandbox-dns
image: coredns/coredns:1.7.0
volumes:
- coredns-conf:/config/
command:
- -conf
- /config/Corefile
ports:
- "127.0.0.1:5300:53/udp"
depends_on:
dockergen-dns:
condition: service_healthy
networks:
internal:
ipv4_address: 10.5.0.100
default: {}
dns-external:
container_name: aws-sandbox-dns-external
image: coredns/coredns:1.7.0
volumes:
- coredns-conf-external:/config/
command:
- -conf
- /config/Corefile
ports:
- "127.0.0.1:53:53/udp"
- "127.0.0.1:53:53/tcp"
depends_on:
dockergen-dns-external:
condition: service_healthy
networks:
default: { }
dockergen-dns:
image: nginxproxy/docker-gen:0.9.0
command: -notify-sighup aws-sandbox-dns -watch /etc/docker-gen/templates/Corefile.tmpl /config/Corefile
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${AWS_SANDBOX_DIR-.}/dns/Corefile.tmpl:/etc/docker-gen/templates/Corefile.tmpl
- coredns-conf:/config/
healthcheck:
test: ["CMD-SHELL", "[ -f /config/Corefile ]"]
interval: 5s
networks:
- internal
dockergen-dns-external:
image: nginxproxy/docker-gen:0.9.0
command: -notify-sighup aws-sandbox-dns-external -watch /etc/docker-gen/templates/Corefile.tmpl /config/Corefile
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${AWS_SANDBOX_DIR-.}/dns/Corefile.external.tmpl:/etc/docker-gen/templates/Corefile.tmpl
- coredns-conf-external:/config/
healthcheck:
test: ["CMD-SHELL", "[ -f /config/Corefile ]"]
interval: 5s
networks:
- internal
cert-helper:
build: ${AWS_SANDBOX_DIR-.}/cert-helper
volumes:
- "mitmproxy:/mitmproxy:ro"
- "caddy-data:/caddy:ro"
- "certificates:/tmp/certs"
healthcheck:
test: ["CMD-SHELL", "[ -f /tmp/certs/caddy.pem ]"]
interval: 5s
start_period: 5s
retries: 6
networks:
internal:
internal: true
ipam:
config:
- subnet: 10.5.0.0/16
volumes:
mitmproxy:
certificates:
caddy-conf:
caddy-data:
db-data:
coredns-conf:
coredns-conf-external: