-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
69 lines (69 loc) · 1.83 KB
/
docker-compose.yml
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
version: "3.0"
services:
tedge:
build: ./tedge
hostname: tedge
container_name: thin-edge-setup.io
expose:
- "1883"
- "9080"
ports:
- "1883:1883"
- "9080:9080"
environment:
- MONGO_HOST=mongodb1
- MONGO_PORT=27017
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Test version: map local directory and build angular locally (three changes are required in total)
# 1. map locally
# 2. run in tedge cmd: npm run build to build outside of the container, the result is then mapped with the following volume mapping: ./:/app/
# 3. enable entrypoint ENTRYPOINT ["/bin/bash", "/app/tedge/start.sh"] in tedge/Dockerfile
# - ./:/app/
- ./tedge/etc/tedge:/etc/tedge
mqtt_collector:
build: ./MQTT_Collector
hostname: mqtt_collector
container_name: mqtt_collector
deploy:
restart_policy:
condition: on-failure
environment:
- MQTT_BROKER=tedge
- MQTT_PORT=1883
- MONGO_HOST=mongodb1
- MONGO_PORT=27017
mongodb1:
image: mongo:latest
container_name: mongodb1
environment:
MONGO_REPLICA_SET_NAME: rsmongo
expose:
- "27017"
ports:
- "27017:27017"
command:
[
"--bind_ip_all",
"--replSet",
"rsmongo",
"--journal",
"--dbpath",
"/data/db"
]
volumes:
- ./mongo/data1/db:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
- ./mongo/data1/configdb:/data/configdb
deploy:
restart_policy:
condition: on-failure
mongosetup:
image: "mongo-setup"
build: "./mongo"
container_name: "mongosetup"
environment:
TTL_DOCUMENT: 300 # documents are automatically deleted after 300 seconds
depends_on:
- mongodb1
volumes:
- ./mongo/data2:/data/