Microservice to provide the Controller for our Traffic Light and Space Status.
This could be done in NodeRed, but it is part of our critical infrastrukture and should run independently.
Configuration is done using environment variables:
PORT
: Target port when used with docker-compose (default8080
)MQTT_BROKER
: MQTT broker server (defaultmqtt
)MQTT_PORT
: MQTT broker port (default1883
)MQTT_LEVER_STATE_TOPIC
: MQTT topic to listen for lever state messages (defaultlever
)MQTT_DOOR_EVENTS_TOPIC
: MQTT topic to listen for door events (defaultdoor
)MQTT_SPACESTATUS_ISOPEN_TOPIC
: MQTT topic to publish space status (defaultisOpen
)MQTT_SPACESTATUS_LASTCHANGE_TOPIC
: MQTT topic to publish last change messages (defaultlastchange
)MQTT_TRAFFIC_LIGHT_TOPIC
: MQTT topic to publish traffic light status (defaulttrafficlight
)
docker run --rm -it \
-p 8080:8080 \
netz39/ampel-controller
To run with docker-compose copy .env.template
to .env
and edit the necessary variables. Then start with:
docker-compose up --build
Please note that this compose file will rebuild the image based on the repository. This is helpful during development and not intended for production use.
When done, please don't forget to remove the deployment with
docker-compose down
- Stefan Haun (@penguineer)
MIT © 2024 Netz39 e.V. and contributors