-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
75 lines (70 loc) · 1.74 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
services:
mqtt-broker:
image: eclipse-mosquitto:latest
container_name: mqtt-broker
ports:
- "1883:1883"
volumes:
- ./mosquitto/config:/mosquitto/config
- mosquitto-data:/mosquitto/data
- mosquitto-log:/mosquitto/log
networks:
- mqtt-network
hostname: mqtt-broker
labels:
kompose.service.type: LoadBalancer
mongo:
image: mongo:latest
container_name: mongo
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- mqtt-network
labels:
kompose.service.type: LoadBalancer
mqtt-to-mongodb:
image: node:22-slim
container_name: mqtt-to-mongodb
volumes:
- ./mongo/mqtt-to-mongodb.js:/app/mqtt-to-mongodb.js
- ./mongo/auto-indexer.js:/app/auto-indexer.js
- ./mongo/util.js:/app/util.js
- ./mongo/package.json:/app/package.json
- ./config.json:/app/config.json
working_dir: /app
command: ["sh", "-c", "npm install && node mqtt-to-mongodb.js"]
depends_on:
- mqtt-broker
- mongo
networks:
- mqtt-network
fastapi:
image: tiangolo/uvicorn-gunicorn-fastapi:python3.8
container_name: fastapi
command: [
"sh",
"-c",
# Install requirements.txt before running the API
"pip install -r requirements.txt && uvicorn main:app --host 0.0.0.0 --port 8000",
]
volumes:
- ./api/main.py:/app/main.py
- ./api/requirements.txt:/app/requirements.txt
- ./config.json:/app/config.json
ports:
- "8000:8000"
depends_on:
- mongo
networks:
- mqtt-network
labels:
kompose.service.type: LoadBalancer
volumes:
mosquitto-data:
mosquitto-log:
mongo-data:
networks:
mqtt-network:
driver: bridge