docker-compose.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. version: '2.3'
  2. volumes:
  3. config:
  4. services:
  5. homeassistant:
  6. build: .
  7. image: fphammerle/home-assistant
  8. #read_only: true
  9. volumes:
  10. - type: volume
  11. source: config
  12. target: /config
  13. read_only: false
  14. - type: tmpfs
  15. # workaround for async_dns<1.1.10:
  16. # > File "/usr/local/lib/python3.8/site-packages/async_dns/core/config/root.py", line 16, in <module>
  17. # > os.makedirs(CONFIG_DIR, exist_ok=True)
  18. # > File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
  19. # > mkdir(name, mode)
  20. # > PermissionError: [Errno 13] Permission denied: '/home/hass/.config/async_dns'
  21. # introduced in https://github.com/gera2ld/async_dns/commit/16cf6361ebfcc62fc6339e5194d013e8a8607fa2
  22. # injected into home-assistant image >=2021.4.0 via
  23. # - https://github.com/bdraco/aiodiscover/commit/d1db9a79df7c56b7930f04a79a36c2360ce8cd18#diff-610f365ee23052059bddd764ee702dce7e295c7b6563f1fd8980c8995205e079R6
  24. # - https://github.com/home-assistant/core/commit/2ff94c8ed9fecd4dd7984d1f2d2600289c983a8b#diff-e441c4ef86b6cbecc1fe68515ed64a515941c872a72b40e85efbefc66ecb41b4R3
  25. # fix: https://github.com/gera2ld/async_dns/pull/23/files
  26. # https://github.com/gera2ld/async_dns/pull/23/commits/2e2bfd2a6428997191dce16d99d5a6d7ab70acd1
  27. # related issue: https://github.com/home-assistant/core/issues/49205
  28. target: /home/hass/.config/async_dns
  29. tmpfs:
  30. mode: 1777
  31. size: 4k
  32. ports: ['127.0.0.1:8123:8123']
  33. cap_drop: [ALL]
  34. security_opt: [no-new-privileges]
  35. # docker-compose >=2.2,<3
  36. cpus: 2
  37. mem_limit: 512M
  38. restart: on-failure
  39. # https://docs.docker.com/compose/compose-file/compose-file-v2/