docker-compose.yml 1.1 KB

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