-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose-build.yml
More file actions
134 lines (126 loc) · 4.21 KB
/
Copy pathdocker-compose-build.yml
File metadata and controls
134 lines (126 loc) · 4.21 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
name: openclaw-observability-platform
services:
# =============================================================================
# frontend - 静态文件服务
# =============================================================================
frontend:
build:
context: .
dockerfile: ./frontend/Dockerfile
container_name: frontend
restart: unless-stopped
ports:
- "${FRONTEND_HTTP_PORT:-80}:80"
- "${FRONTEND_HTTPS_PORT:-3000}:3000"
depends_on:
- backend
healthcheck:
test: ["CMD-SHELL", "curl -k https://127.0.0.1:3000 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- openclaw-net
# =============================================================================
# backend 服务 - Node.js 后端
# =============================================================================
backend:
build:
context: .
dockerfile: ./backend/Dockerfile
container_name: backend
restart: unless-stopped
ports:
- "${API_PORT:-8787}:8787"
environment:
- DORIS_HOST=${DORIS_HOST:-doris}
- DORIS_PORT=${DORIS_PORT:-9030}
- DORIS_USER=${DORIS_USER:-root}
- DORIS_PASSWORD=${DORIS_PASSWORD:-}
- DORIS_DATABASE=${DORIS_DATABASE:-opsRobot}
- PORT=8787
depends_on:
- doris
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 8787 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- openclaw-net
# =============================================================================
# Apache Doris - 单节点服务
# =============================================================================
doris:
image: ${DORIS_IMAGE:-apache/doris:4.0.3-all-slim}
container_name: doris
hostname: doris
restart: unless-stopped
privileged: true
deploy:
resources:
limits:
cpus: "4"
memory: 16G
reservations:
cpus: "1"
memory: 4G
ports:
- "${DORIS_FE_HTTP_PORT:-8030}:8030" # FE HTTP port (Web UI)
- "${DORIS_FE_MYSQL_PORT:-9030}:9030" # FE MySQL protocol port
- "${DORIS_BE_HTTP_PORT:-8040}:8040" # BE HTTP port
environment:
- SKIP_CHECK_ULIMIT=true
- "TZ=${TIMEZONE:-Asia/Shanghai}"
- DORIS_PASSWORD=${DORIS_PASSWORD:-}
volumes:
- doris_data:/opt/apache-doris
- ./scripts/init-doris-schema.sql:/opt/apache-doris/init-doris-schema.sql:ro
- ./scripts/start-doris.sh:/start-doris.sh:ro
entrypoint: ["/bin/bash", "/start-doris.sh"]
healthcheck:
test: ["CMD-SHELL", "mysql -h 127.0.0.1 -P 9030 -uroot -e 'SHOW BACKENDS\\G' | grep -q 'Alive: true' || exit 1"]
interval: 15s
timeout: 10s
retries: 20
start_period: 180s
networks:
- openclaw-net
otel-collector:
image: otel/opentelemetry-collector-contrib:0.144.0
hostname: otel-collector
container_name: otel-collector
command: ["--config=/etc/otelcol/otel-collector-config.yaml"]
volumes:
- ./otel-config.yaml:/etc/otelcol/otel-collector-config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "8888:8888" # Prometheus metrics (collector self-monitoring)
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # Health check extension
environment:
- DORIS_FE_HTTP_ENDPOINT=${DORIS_FE_HTTP_ENDPOINT:-http://doris:8040}
- DORIS_FE_MYSQL_ENDPOINT=${DORIS_FE_MYSQL_ENDPOINT:-doris:9030}
- DORIS_USERNAME=${DORIS_USERNAME:-root}
- DORIS_PASSWORD=${DORIS_PASSWORD:-}
- DORIS_DATABASE=${DORIS_DATABASE:-otel}
- DORIS_TABLE_LOGS=${DORIS_TABLE_LOGS:-otel_logs}
- DORIS_TABLE_TRACES=${DORIS_TABLE_TRACES:-otel_traces}
- DORIS_TABLE_METRICS=${DORIS_TABLE_METRICS:-otel_metrics}
restart: unless-stopped
networks:
- openclaw-net
networks:
openclaw-net:
driver: bridge
name: openclaw-observability-platform-network
volumes:
doris_data:
driver: local
driver_opts:
type: none
o: bind
device: ~/var/doris_data # 将宿主机目录绑定到容器卷,确保数据持久化并且可以在宿主机上访问