-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
116 lines (107 loc) · 2.59 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
116 lines (107 loc) · 2.59 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
services:
caddy:
image: caddy:2.8-alpine
container_name: wemcp-caddy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./deploy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
networks:
- wemcp_gateway_network
depends_on:
- wemcp-gateway
wemcp-gateway:
build:
context: .
dockerfile: Dockerfile
container_name: wemcp-gateway
environment:
DATABASE_URL: postgres://wemcp:wemcp123456@db:5432/wemcp
SERVER_MODE: ${SERVER_MODE:-production}
OTEL_ENABLED: ${OTEL_ENABLED:-true}
ports:
- "8000:8000"
depends_on:
wemcp-gateway-db:
condition: service_healthy
networks:
- wemcp_gateway_network
restart: always
wemcp-gateway-db:
image: postgres:latest
container_name: wemcp-gateway-db
environment:
POSTGRES_USER: wemcp
POSTGRES_PASSWORD: wemcp123456
POSTGRES_DB: wemcp
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
networks:
- wemcp_gateway_network
healthcheck:
test: [ "CMD-SHELL", "PGPASSWORD=wemcp123456 pg_isready -U wemcp" ]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
wemcp-gateway-pgadmin:
image: dpage/pgadmin4:latest
container_name: wemcp-gateway-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@wemcp.cn
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "5050:80"
networks:
- wemcp_gateway_network
depends_on:
- wemcp-gateway-db
wemcp-gateway-prometheus:
image: prom/prometheus:v2.53.0
container_name: wemcp-gateway-prometheus
ports:
- "9090:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
volumes:
- prometheus_data:/prometheus
configs:
- source: prometheus_config
target: /etc/prometheus/prometheus.yml
depends_on:
- wemcp-gateway
networks:
- wemcp_gateway_network
restart: unless-stopped
configs:
prometheus_config:
content: |
global:
scrape_interval: 15s
evaluation_interval: 30s
scrape_configs:
- job_name: 'wemcp-gateway'
static_configs:
- targets: ['wemcp-gateway:8000']
metrics_path: '/metrics'
scrape_interval: 15s
networks:
wemcp_gateway_network:
name: wemcp_gateway_network
driver: bridge
ipam:
driver: default
config:
- subnet: 172.10.10.0/24
volumes:
db_data:
prometheus_data:
caddy_data:
caddy_config: