Dockerfile 288 B

123456789101112
  1. FROM python:3.8-slim
  2. # Install Mosquitto to act as the MQTT broker
  3. RUN apt-get update && \
  4. apt-get install -y mosquitto mosquitto-clients
  5. # Expose MQTT port
  6. EXPOSE 1883
  7. COPY mosquitto.conf /mosquitto.conf
  8. # Run Mosquitto and the Python MQTT client
  9. CMD mosquitto -c /mosquitto.conf