docker-compose.yml 511 B

123456789101112131415161718192021
  1. version: '2.2'
  2. networks:
  3. default:
  4. driver_opts:
  5. com.docker.network.bridge.name: switchbot-mqtt
  6. services:
  7. broker:
  8. # v2 binds to loopback device
  9. # https://github.com/eclipse/mosquitto/blob/v2.0.0/ChangeLog.txt#L6
  10. image: docker.io/eclipse-mosquitto:1.6
  11. user: mosquitto
  12. read_only: yes
  13. ports: ['127.0.0.1:1883:1883/tcp']
  14. cap_drop: [all]
  15. security_opt: [no-new-privileges]
  16. cpus: 0.4
  17. mem_limit: 32M
  18. # https://docs.docker.com/compose/compose-file/compose-file-v2/