24 lines
737 B
Markdown
24 lines
737 B
Markdown
# 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
|
|
```
|