-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (134 loc) · 3.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
143 lines (134 loc) · 3.56 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
version: '3.8'
services:
api-gateway:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- AG_SERVER_PORT=8080
# - AG_DATABASE_DRIVER=postgres
# - AG_DATABASE_DSN=postgres://postgres:postgres@postgres:5432/apigateway?sslmode=disable
- AG_CACHE_TYPE=redis
- AG_CACHE_ADDRESS=redis:6379
- AG_LOGGING_LEVEL=debug
- AG_LOGGING_FORMAT=console
- AG_LOGGING_PRODUCTION=false
# - LETSENCRYPT_EMAIL=seuemail@example.com
volumes:
# - apigateway_data:/app
- ./config/config.yaml:/app/config/config.yaml
depends_on:
- postgres
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health/liveness"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
networks:
- api-gateway-network
postgres:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=apigateway
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 3
networks:
- api-gateway-network
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
networks:
- api-gateway-network
prometheus:
image: prom/prometheus:v2.43.0
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
networks:
- api-gateway-network
otel-collector:
image: otel/opentelemetry-collector:latest
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- ./monitoring/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "8888:8888" # Metrics internas do Collector
- "8889:8889" # Endpoint de métricas para o Prometheus
- "13133:13133" # Health check
depends_on:
- zipkin
networks:
- api-gateway-network
zipkin:
image: openzipkin/zipkin:latest
ports:
- "9411:9411"
networks:
- api-gateway-network
healthcheck:
test: [ "CMD", "wget", "-qO-", "http://localhost:9411/health" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
grafana:
image: grafana/grafana:9.5.1
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_INSTALL_PLUGINS=grafana-piechart-panel
restart: unless-stopped
depends_on:
- prometheus
networks:
- api-gateway-network
networks:
api-gateway-network:
driver: bridge
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
# apigateway_data: