docker-compose.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. version: '2.2'
  2. #volumes:
  3. # config:
  4. services:
  5. broker:
  6. image: docker.io/eclipse-mosquitto:latest
  7. user: mosquitto
  8. read_only: yes
  9. cap_drop: [all]
  10. security_opt: [no-new-privileges]
  11. cpus: 0.4
  12. mem_limit: 32M
  13. client:
  14. build: .
  15. image: fphammerle/systemctl-mqtt
  16. volumes:
  17. #- config:/etc/systemctl-mqtt:ro
  18. - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:rw
  19. command: systemctl-mqtt
  20. --poweroff-delay-seconds 60
  21. --mqtt-host broker
  22. --mqtt-disable-tls
  23. # --mqtt-username raspberrypi
  24. # --mqtt-password-file /etc/systemctl-mqtt/mqtt-password
  25. hostname: raspberrypi
  26. userns_mode: host
  27. # prefering explicit user specification over "USER 0" in Dockerfile
  28. # to avoid accidental container startup without
  29. # secure apparmor profile and dropped capabilities
  30. user: '0'
  31. read_only: true
  32. cap_drop: [all]
  33. security_opt:
  34. - no-new-privileges
  35. # $ sudo apparmor_parser --replace ./docker-apparmor-profile
  36. # raspberrypi kernel apparmor: https://github.com/raspberrypi/linux/pull/1698#issuecomment-684989048
  37. # https://github.com/raspberrypi/linux/commit/a3e07c5dfef2664fc1d900ebb4a3f91c04ab700b
  38. - apparmor=systemctl-mqtt
  39. # docker-compose >=2.2,<3
  40. cpus: 0.4
  41. mem_limit: 32M
  42. # https://docs.docker.com/compose/compose-file/compose-file-v2/