1
0
forked from jchomaz/Vulture
Files
Vulture/VContainers/run.sh

32 lines
1.0 KiB
Bash
Raw Normal View History

2025-11-30 10:22:53 +01:00
#!/bin/bash
set -e
# Move to repository root
cd "$(dirname "$0")/.."
NETWORK_NAME="vulture-net"
echo "Creating network $NETWORK_NAME..."
if podman network exists $NETWORK_NAME; then
echo "Network $NETWORK_NAME already exists."
2025-11-30 10:22:53 +01:00
else
podman network create $NETWORK_NAME
2025-11-30 10:22:53 +01:00
fi
echo "Starting NanoMQ..."
# 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
2025-11-30 10:22:53 +01:00
echo "Starting VNode..."
# 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
2025-11-30 10:22:53 +01:00
echo "Starting VApp..."
# VApp (nginx) needs port 80 exposed
podman run -dt --rm --network $NETWORK_NAME --name vapp -p 8080:80 vapp:latest
2025-11-30 10:22:53 +01:00
echo "All containers started on network $NETWORK_NAME."