forked from jchomaz/Vulture
Lancement en mode network plutot que pod
This commit is contained in:
@@ -18,11 +18,11 @@ mqtt {
|
||||
}
|
||||
|
||||
listeners.tcp {
|
||||
bind = "127.0.0.1:1883"
|
||||
bind = "0.0.0.0:1883"
|
||||
}
|
||||
|
||||
listeners.ws {
|
||||
bind = "127.0.0.1:9001"
|
||||
bind = "0.0.0.0:9001"
|
||||
}
|
||||
|
||||
http_server {
|
||||
|
||||
@@ -4,21 +4,28 @@ set -e
|
||||
# Move to repository root
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "Creating Pod vulture..."
|
||||
# Check if pod exists to avoid error
|
||||
if podman pod exists vulture; then
|
||||
echo "Pod vulture already exists."
|
||||
NETWORK_NAME="vulture-net"
|
||||
|
||||
echo "Creating network $NETWORK_NAME..."
|
||||
if podman network exists $NETWORK_NAME; then
|
||||
echo "Network $NETWORK_NAME already exists."
|
||||
else
|
||||
podman pod create --name vulture -p 8080:80 -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 9001:9001
|
||||
podman network create $NETWORK_NAME
|
||||
fi
|
||||
|
||||
echo "Starting NanoMQ..."
|
||||
podman run -dt --rm --pod vulture --name nanomq -v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf
|
||||
# NanoMQ needs to expose ports for external access (e.g. VApp frontend) and be on the network for VNode
|
||||
podman run -dt --rm --network $NETWORK_NAME --name nanomq \
|
||||
-p 1883:1883 -p 9001:9001 -p 8081:8081 -p 8083:8083 -p 8883:8883 \
|
||||
-v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf \
|
||||
docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf
|
||||
|
||||
echo "Starting VNode..."
|
||||
podman run -dt --rm --pod vulture --name vnode vnode:latest
|
||||
# VNode connects to nanomq via the network, no ports needed on host unless for debugging
|
||||
podman run -dt --rm --network $NETWORK_NAME --name vnode vnode:latest
|
||||
|
||||
echo "Starting VApp..."
|
||||
podman run -dt --rm --pod vulture --name vapp vapp:latest
|
||||
# VApp (nginx) needs port 80 exposed
|
||||
podman run -dt --rm --network $NETWORK_NAME --name vapp -p 8080:80 vapp:latest
|
||||
|
||||
echo "All containers started."
|
||||
echo "All containers started on network $NETWORK_NAME."
|
||||
|
||||
@@ -5,7 +5,7 @@ podman stop vapp || echo "vapp not running"
|
||||
podman stop vnode || echo "vnode not running"
|
||||
podman stop nanomq || echo "nanomq not running"
|
||||
|
||||
echo "Removing pod..."
|
||||
podman pod rm vulture || echo "Pod vulture not found"
|
||||
echo "Removing network..."
|
||||
podman network rm vulture-net || echo "Network vulture-net not found"
|
||||
|
||||
echo "Cleanup complete."
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const mqtt = require('mqtt');
|
||||
|
||||
// MQTT broker configuration
|
||||
const brokerUrl = 'mqtt://localhost'; // Broker URL (change if needed)
|
||||
const brokerUrl = 'mqtt://nanomq'; // Broker URL (change if needed)
|
||||
const clientId = 'buzzer_manager';
|
||||
const options = {
|
||||
clientId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"services": {
|
||||
"mqttHost": "mqtt://localhost",
|
||||
"mqttHost": "mqtt://nanomq",
|
||||
"score": {
|
||||
"MQTTconfig": {
|
||||
"mqttScoreTopic": "game/score",
|
||||
@@ -14,5 +14,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,10 +8,9 @@
|
||||
"yellowBuzzerIP": "8.8.8.8"
|
||||
},
|
||||
"MQTTconfig": {
|
||||
"mqttHost": "mqtt://localhost",
|
||||
"mqttHost": "mqtt://nanomq",
|
||||
"mqttTopic": "buzzer/watcher"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
const mqtt = require('mqtt');
|
||||
|
||||
// Configuration du broker MQTT et de WLED
|
||||
const brokerUrl = 'mqtt://localhost'; // Change ce lien si nécessaire
|
||||
const brokerUrl = 'mqtt://nanomq'; // Change ce lien si nécessaire
|
||||
const clientId = 'light_manager_wled';
|
||||
const wledTopicBase = 'wled/all'; // Le topic de base pour ton ruban WLED
|
||||
const options = {
|
||||
|
||||
Reference in New Issue
Block a user