docker-compose.yml 938 B

123456789101112131415161718192021222324252627282930313233
  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. - apparmor=systemctl-mqtt
  27. # docker-compose >=2.2,<3
  28. cpus: 0.4
  29. mem_limit: 32M
  30. # https://docs.docker.com/compose/compose-file/compose-file-v2/