diff --git a/VContainers/README.md b/VContainers/README.md index 2a88cf1c..4338a07d 100644 --- a/VContainers/README.md +++ b/VContainers/README.md @@ -26,6 +26,15 @@ podman stop vnode podman stop nanomq podman pod rm vulture +## Lancement automatique avec Quadlet + +Copier les fichiers du repertoire quadlet vers ~/.config/containers/systemd/ + +``` +systemctl --user daemon-reload +systemctl --user enable --now vulture.pod +``` + ## Tip sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80 \ No newline at end of file diff --git a/VContainers/quadlet/nanomq.container b/VContainers/quadlet/nanomq.container new file mode 100644 index 00000000..90451478 --- /dev/null +++ b/VContainers/quadlet/nanomq.container @@ -0,0 +1,14 @@ +[Unit] +Description=Broker MQTT NanoMQ +Requires=vulture.pod +After=vulture.pod + +[Container] +Image=docker.io/emqx/nanomq:latest +ContainerName=nanomq +Pod=vulture +# Correspond à -v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf +Volume=./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf + +[Install] +WantedBy=vulture.pod diff --git a/VContainers/quadlet/vapp.container b/VContainers/quadlet/vapp.container new file mode 100644 index 00000000..3501d3d9 --- /dev/null +++ b/VContainers/quadlet/vapp.container @@ -0,0 +1,12 @@ +[Unit] +Description=Application Node.js VApp +Requires=vulture.pod +After=vulture.pod + +[Container] +Image=localhost/vapp:latest +ContainerName=vapp +Pod=vulture + +[Install] +WantedBy=vulture.pod diff --git a/VContainers/quadlet/vnode.container b/VContainers/quadlet/vnode.container new file mode 100644 index 00000000..6fa46d81 --- /dev/null +++ b/VContainers/quadlet/vnode.container @@ -0,0 +1,12 @@ +[Unit] +Description=Application Node.js VNode +Requires=vulture.pod +After=vulture.pod + +[Container] +Image=localhost/vnode:latest +ContainerName=vnode +Pod=vulture + +[Install] +WantedBy=vulture.pod diff --git a/VContainers/quadlet/vulture.pod b/VContainers/quadlet/vulture.pod new file mode 100644 index 00000000..8e5e688b --- /dev/null +++ b/VContainers/quadlet/vulture.pod @@ -0,0 +1,14 @@ +[Unit] +Description=Pod Vulture pour le Broker MQTT et les Applications Node +Wants=network-online.target +After=network-online.target + +[Pod] +# Mappings de ports : Host:Container (ces ports sont partagés par tous les conteneurs) +PublishPort=8080:80 +PublishPort=1883:1883 +PublishPort=8083:8083 +PublishPort=8883:8883 + +[Install] +WantedBy=default.target