2025-11-30 10:22:53 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# Move to repository root
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
2025-11-30 10:34:02 +01:00
|
|
|
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
|
2025-11-30 10:34:02 +01:00
|
|
|
podman network create $NETWORK_NAME
|
2025-11-30 10:22:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Starting NanoMQ..."
|
2025-11-30 10:34:02 +01:00
|
|
|
# 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 \
|
2025-11-30 10:52:49 +01:00
|
|
|
-v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf:Z \
|
2025-11-30 10:34:02 +01:00
|
|
|
docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf
|
2025-11-30 10:22:53 +01:00
|
|
|
|
|
|
|
|
echo "Starting VNode..."
|
2025-11-30 10:34:02 +01:00
|
|
|
# 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
|
|
|
|
2025-11-30 10:57:34 +01:00
|
|
|
echo "Starting VApp (PROD CONFIG)..."
|
2025-11-30 10:34:02 +01:00
|
|
|
# VApp (nginx) needs port 80 exposed
|
2025-11-30 10:52:49 +01:00
|
|
|
podman run -dt --rm --network $NETWORK_NAME --name vapp -p 8080:80 \
|
2025-11-30 10:57:34 +01:00
|
|
|
-v ./VContainers/VApp/config/config_prod.js:/usr/share/nginx/html/config.js:Z \
|
2025-11-30 10:52:49 +01:00
|
|
|
vapp:latest
|
2025-11-30 10:22:53 +01:00
|
|
|
|
2025-11-30 10:57:34 +01:00
|
|
|
echo "All containers started on network $NETWORK_NAME with PROD configuration."
|