-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
executable file
·89 lines (83 loc) · 2.63 KB
/
docker-compose.yaml
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
version: '3'
networks:
web-network:
services:
# docker-influxdb:
# image: influxdb:2.4
# container_name: influxdb
# restart: always
# ports:
# - "8086:8086" #HTTP UI and API port
# environment:
# DOCKER_INFLUXDB_INIT_MODE: "setup"
# DOCKER_INFLUXDB_INIT_USERNAME: "root" #创建管理员用户
# DOCKER_INFLUXDB_INIT_PASSWORD: "a123456a" #创建管理员密码,太简单会报错
# DOCKER_INFLUXDB_INIT_ORG: "miot-tracer" #组织名称
# DOCKER_INFLUXDB_INIT_BUCKET: "node1"
# volumes:
# - "./influxdb/data:/var/lib/influxdb2"
# - "./influxdb/config:/etc/influxdb2"
# networks:
# - web-network
# miot-tracer-redis:
# image: redis
# container_name: redis
# command: redis-server /etc/redis/redis.conf --appendonly yes
# ports:
# - "6379:6379"
# volumes:
# - ./redis-data/redis.conf:/etc/redis/redis.conf
# - ./redis-data/redis:/data
# restart: always
# networks:
# - web-network
# redis-insight:
# image: redislabs/redisinsight:latest
# ports:
# - "8001:8001"
# restart: always
# networks:
# - web-network
# environment:
# - REDIS_URI=redis://miot-tracer-redis:6379
# links:
# - miot-tracer-redis
#-----------------node-----------------
miot-tracer-node_1:
image: debian:bookworm-slim
container_name: miot-tracer-node_1
volumes:
- ./miot_tracing_go:/miot_tracing_go
- ./logFile/miot_tracer_log_1.json:/logFile/miot_tracer_log.json
- /etc/ssl/certs:/etc/ssl/certs:ro #把宿主机的证书文件挂载到容器中
command: ["/miot_tracing_go"]
environment:
- NODE_ID=1
- INFLUXDB_TOKEN=J_xeoyLkPQFHBilXk4ELHjV85A7fFtIJvlo3GTjmKnF3QPZU63H7N0FH5_x7JBMPy3MRvVwoeoW0rnReDyLuPg==
- INFLUXDB_URL=http://influxdb:8086
- INFLUXDB_BUCKET=node1
- REDIS_URL=redis:6379
networks:
- web-network
# depends_on:
# - docker-influxdb
# - miot-tracer-redis
miot-tracer-node_2:
image: debian:bookworm-slim
container_name: miot-tracer-node_2
volumes:
- ./miot_tracing_go:/miot_tracing_go
- ./logFile/miot_tracer_log_2.json:/logFile/miot_tracer_log.json
- /etc/ssl/certs:/etc/ssl/certs:ro
command: ["/miot_tracing_go"]
environment:
- NODE_ID=2
- INFLUXDB_TOKEN=J_xeoyLkPQFHBilXk4ELHjV85A7fFtIJvlo3GTjmKnF3QPZU63H7N0FH5_x7JBMPy3MRvVwoeoW0rnReDyLuPg==
- INFLUXDB_URL=http://influxdb:8086
- INFLUXDB_BUCKET=node2
- REDIS_URL=redis:6379
networks:
- web-network
# depends_on:
# - docker-influxdb
# - miot-tracer-redis