Commit f6886912 authored by Mele's avatar Mele
Browse files

added mosquitto and influxdb to the .yaml file it now starts with the other...

added mosquitto and influxdb to the .yaml file it now starts with the other parts like frontend and backend
parent 78b70c80
No related merge requests found
Showing with 65 additions and 3 deletions
+65 -3
version: '3.9'
services:
# 🟡 MQTT-Backend (wie gehabt)
mqtt-backend:
image: mqtt-influx-backend
container_name: mqtt-backend
......@@ -9,10 +12,11 @@ services:
env_file:
- ../mqtt_to_influxdb/.env
restart: unless-stopped
#depends_on:
# - influxdb
# - mosquitto
depends_on:
- influxdb
- mosquitto
# 🔵 Django-Backend
backend:
build: ./backend
ports:
......@@ -20,6 +24,7 @@ services:
volumes:
- ./backend:/app
# 🟣 Vite-Frontend
frontend:
build: ./frontend
ports:
......@@ -29,3 +34,37 @@ services:
- /app/node_modules
stdin_open: true
tty: true
# 🔷 Mosquitto (MQTT Broker)
mosquitto:
image: eclipse-mosquitto:2
container_name: mosquitto
ports:
- "1883:1883" # MQTT Port
- "9001:9001" # WebSocket Port (optional)
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
- ./mosquitto/run:/var/run/mosquitto
restart: unless-stopped
# 🔶 InfluxDB
influxdb:
image: influxdb:2.7
container_name: influxdb
ports:
- "8086:8086"
volumes:
- influxdb-data:/var/lib/influxdb2
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=admin
- DOCKER_INFLUXDB_INIT_PASSWORD=admin123
- DOCKER_INFLUXDB_INIT_ORG=my-org
- DOCKER_INFLUXDB_INIT_BUCKET=my-bucket
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-token
restart: unless-stopped
volumes:
influxdb-data:
\ No newline at end of file
# mosquitto.conf
pid_file /var/run/mosquitto/mosquitto.pid
user mosquitto
# MQTT Port
listener 1883
# WebSocket Port (optional)
listener 9001
protocol mqtt
# Logging
log_dest file /mosquitto/log/mosquitto.log
# Datenbank
persistence true
persistence_location /mosquitto/data/
# Max. Verbindungen
max_inflight_messages 100
# Default Authentifizierung (optional, falls du es später brauchst)
allow_anonymous true
File added
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment