test: add docker-compose with mosquitto and python subscriber

This commit is contained in:
2025-12-28 15:08:02 +01:00
parent c866346c06
commit 6774c35f1f
4 changed files with 104 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Test compose
This folder contains a simple Docker Compose stack to run the Go server together with an MQTT broker and a Python subscriber client.
Quickstart:
```bash
cd test
docker compose up --build
```
- The Go server is built from the repository `Dockerfile` and is configured via environment variables in `docker-compose.yml`.
- The MQTT broker is `eclipse-mosquitto` and is exposed on port `1883`.
- The `subscriber` service runs `subscribe.py` and prints any messages published to the `lambdaiot` topic.
To run the Python subscriber locally instead of in Docker:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
MQTT_BROKER=localhost:1883 MQTT_TOPIC=lambdaiot python subscribe.py
```