feat: Smart City Digital Twin Martinique - Simulateur IoT multi-broker
This commit is contained in:
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM python:3.12-slim
|
||||
WORKDIR /app
|
||||
RUN pip install --no-cache-dir paho-mqtt requests
|
||||
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()"]
|
||||
Reference in New Issue
Block a user