-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (85 loc) · 2.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (85 loc) · 2.38 KB
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
services:
# --- 1. The Developer Station ---
# This is where you will attach to run 'cargo run'
dev:
build:
context: .
dockerfile: docker/dev.Dockerfile
container_name: pingora_dev
hostname: dev.pingora.local
user: "1000:1000"
volumes:
- .:/app
- ./conf/keys:/keys:ro # Read-only certs
networks:
pingora_net:
ipv4_address: 172.28.0.10
environment:
- RUST_LOG=info
- SSL_CERT_FILE=/keys/ca.crt
# --- 2. The Clients (Traffic Generators) ---
# Two distinct IPs to test Rate Limiting & IP Filtering
client_1:
image: wbitt/network-multitool
container_name: pingora_client_1
hostname: client1.pingora.local
volumes:
- ./conf/keys:/keys:ro
networks:
pingora_net:
ipv4_address: 172.28.0.30
client_2:
image: wbitt/network-multitool
container_name: pingora_client_2
hostname: client2.pingora.local
volumes:
- ./conf/keys:/keys:ro
networks:
pingora_net:
ipv4_address: 172.28.0.31
# --- 3. Basic Upstreams (Echo Servers) ---
# Simple HTTP for Load Balancing & Failover tests
upstream_blue:
image: hashicorp/http-echo
hostname: blue.pingora.local
command: ["-text='Response from BLUE'", "-listen=:8080"]
networks:
pingora_net:
ipv4_address: 172.28.0.20
upstream_green:
image: hashicorp/http-echo
hostname: green.pingora.local
command: ["-text='Response from GREEN'", "-listen=:8080"]
networks:
pingora_net:
ipv4_address: 172.28.0.21
# --- 4. Advanced Upstream (The Specialist) ---
# Handles HTTPS, mTLS, HTTP/2 (H2C), and Cache Headers
upstream_advanced:
image: nginx:alpine
container_name: upstream_advanced
hostname: advanced.pingora.local
volumes:
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf/keys:/etc/nginx/certs:ro
networks:
pingora_net:
ipv4_address: 172.28.0.22
# --- 5. gRPC Upstream ---
# Dedicated gRPC server for Module 3
upstream_grpc:
image: moul/grpcbin
container_name: upstream_grpc
hostname: grpc.pingora.local
networks:
pingora_net:
ipv4_address: 172.28.0.23
volumes:
- ./conf/keys/grpc.crt:/root/cert/server.crt
- ./conf/keys/grpc.key:/root/cert/server.key
networks:
pingora_net:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/24