-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (83 loc) · 1.89 KB
/
docker-compose.yml
File metadata and controls
91 lines (83 loc) · 1.89 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
version: "3.9"
services:
mqtt:
image: eclipse-mosquitto
container_name: mqtt
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
postgres:
image: postgres:15
container_name: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
mqtt_consumer:
build:
context: .
dockerfile: Dockerfile.consumer
container_name: mqtt_consumer
depends_on:
- mqtt
- postgres
environment:
- MQTT_BROKER=${MQTT_BROKER}
- MQTT_PORT=${MQTT_PORT}
- MQTT_TOPIC=${MQTT_TOPIC}
- PG_HOST=${PG_HOST}
- PG_PORT=${PG_PORT}
- PG_DB=battery_data
- PG_USER=${PG_USER}
- PG_PASS=${PG_PASS}
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: battery_api
ports:
- "5000:5000"
depends_on:
- postgres
- mqtt
environment:
- PG_HOST=postgres
- PG_PORT=5432
- PG_DB=battery_data
- PG_USER=admin
- PG_PASS=${PG_PASS}
- MQTT_BROKER=mqtt
- MQTT_PORT=1883
- MQTT_TOPIC=stm/dp
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: frontend
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
depends_on:
- backend
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
ports:
- "3003:3003"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana-data:/var/lib/grafana
volumes:
pgdata:
grafana-data: