-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
76 lines (70 loc) · 1.68 KB
/
docker-compose.yaml
File metadata and controls
76 lines (70 loc) · 1.68 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
version: '3.8'
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- gateway-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# API Gateway - 本地开发版本
api-gateway-local:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
- "8443:8443"
- "5005:5005"
environment:
- SPRING_PROFILES_ACTIVE=dev
- REDIS_HOST=redis
- REDIS_PORT=6379
- GATEWAY_RATELIMIT_ENABLED=true
- GATEWAY_RATELIMIT_CAPACITY=1000
- GATEWAY_RATELIMIT_REFILL_RATE=100
- GATEWAY_DISCOVERY_TYPE=memory
- GATEWAY_LOG_LEVEL=DEBUG
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
depends_on:
redis:
condition: service_healthy
networks:
- gateway-network
volumes:
- ./logs:/app/logs
- ./src:/app/src:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
# 模拟后端服务进行测试
mock-user-service:
image: nginx:alpine
ports:
- "8081:80"
volumes:
- ./test/mock-responses:/usr/share/nginx/html
networks:
- gateway-network
mock-product-service:
image: nginx:alpine
ports:
- "8082:80"
volumes:
- ./test/mock-responses:/usr/share/nginx/html
networks:
- gateway-network
volumes:
redis-data:
networks:
gateway-network:
driver: bridge