Files
smart-city-digital-twin-mar…/Dockerfile
Eric FELIXINE ad613beefb feat: Pulsar distribution service (Simulator → Pulsar → Brokers)
- Fix Pulsar: use binary client (port 6650) instead of non-existent REST /produce API
- Add pulsar-client to Dockerfile
- Create pulsar/distribution.py: consumes Pulsar and republishes to MQTT (EMQX/Mosquitto), NGSI-LD (Orion/Stellio), FROST
- Add docker-compose.distribution.yml for the distribution service
- Tested: Messages successfully distributed to EMQX and Orion-LD
- Update session resume
2026-05-05 10:20:13 -04:00

9 lines
692 B
Docker

FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir paho-mqtt requests influxdb-client pulsar-client
COPY simulator.py /app/
EXPOSE 8081
# Healthcheck endpoint (simple HTTP server)
RUN echo '#!/usr/bin/env python3\nimport http.server, threading, os\nclass H(http.server.BaseHTTPRequestHandler):\n def do_GET(self):\n self.send_response(200)\n self.end_headers()\n self.wfile.write(b"OK")\n def log_message(self, s, *a): pass\nthreading.Thread(target=lambda: http.server.HTTPServer(("0.0.0.0", 8081), H).serve_forever(), daemon=True).start()\nimport time; time.sleep(86400)' > /healthcheck.py
CMD ["python", "-c", "import simulator; simulator.main()"]