docker: add wait-for-mqtt entrypoint; remove compose override

This commit is contained in:
2025-12-28 15:17:28 +01:00
parent 0135924f7f
commit 79fcf7389f
3 changed files with 28 additions and 4 deletions

View File

@@ -16,8 +16,8 @@ services:
- MQTT_TOPIC=lambdaiot
depends_on:
- mosquitto
# ensure mosquitto is reachable before launching the server
command: sh -c "apk add --no-cache netcat-openbsd >/dev/null 2>&1 || true; until nc -z mosquitto 1883; do echo waiting for mosquitto...; sleep 1; done; /usr/local/bin/server"
# server image now waits for MQTT broker itself via entrypoint
# no command override needed
mosquitto:
image: eclipse-mosquitto:2.0