Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
123 lines (116 loc) · 3.58 KB
/
Copy pathcompose.yaml
File metadata and controls
123 lines (116 loc) · 3.58 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
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
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: papi_control
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- papi-postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d papi_control"]
interval: 2s
timeout: 3s
retries: 30
redis:
image: redis:7-alpine
command: redis-server --save 60 1 --loglevel warning
volumes:
- papi-redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 3s
retries: 30
control-plane:
build: ./control-plane
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/papi_control
TEST_DATABASE_URL: postgres://postgres:postgres@postgres:5432/papi_control_test
REDIS_URL: redis://redis:6379
CONTROL_PLANE_MASTER_KEY: BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc=
INTERNAL_SERVICE_TOKEN: dev-internal-service-token
GATEWAY_SHARED_SECRET: dev-secret-change-me
ALLOW_INSECURE_DEV_DEFAULTS: "true"
ALLOW_PRIVATE_UPSTREAMS: "true"
CONTROL_PLANE_BIND_HOST: 0.0.0.0
DASHBOARD_PUBLIC_URL: http://localhost:13000
GATEWAY_INTERNAL_URL: http://gateway:8081
ports:
- "127.0.0.1:13000:3000"
- "127.0.0.1:1455:3000"
- "127.0.0.1:54545:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/ready').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
interval: 3s
timeout: 3s
retries: 40
gateway:
build: .
ports: ["127.0.0.1:18080:8080"]
environment:
CONTROL_PLANE_URL: http://control-plane:3000
CONTROL_PLANE_INTERNAL_TOKEN: dev-internal-service-token
CONTROL_PLANE_POLL_INTERVAL: 2s
GATEWAY_INTERNAL_ADDR: :8081
GATEWAY_ID: gateway-compose
depends_on:
control-plane:
condition: service_healthy
fake-upstream:
condition: service_healthy
fake-upstream:
image: golang:1.22
working_dir: /src
volumes: [".:/src"]
command: go run ./test/fakeupstream
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:9001/healthz > /dev/null && curl -fsS http://127.0.0.1:9002/healthz > /dev/null && curl -fsS http://127.0.0.1:9003/healthz > /dev/null && curl -fsS http://127.0.0.1:9010/healthz > /dev/null"]
interval: 2s
timeout: 2s
retries: 30
gateway-bench:
profiles: ["bench"]
build: .
command: ["-config", "/app/config/bench.yaml"]
environment:
GATEWAY_ID: gateway-bench
LITE_STORE_PATH: /tmp/lite-bench.json
volumes: ["./config/bench.yaml:/app/config/bench.yaml:ro"]
depends_on:
- fake-upstream
bench-runner:
profiles: ["bench"]
image: node:22-alpine
working_dir: /bench
volumes: ["./test:/bench"]
environment:
GATEWAY_URL: http://gateway-bench:8080
command: node bench.mjs
depends_on:
- gateway-bench
# Виток 8: optimization-mode matrix (baseline vs each mode, per payload size).
bench-matrix:
profiles: ["bench"]
image: node:22-alpine
working_dir: /bench
volumes: ["./test:/bench"]
environment:
GATEWAY_URL: http://gateway-bench:8080
BENCH_MATRIX: "1"
BENCH_MATRIX_CONC: "20"
BENCH_DURATION_MS: "6000"
BENCH_PAYLOADS: "small,large,huge"
command: node bench.mjs
depends_on:
- gateway-bench
volumes:
papi-postgres:
papi-redis: