docker-compose.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. version: '2.3' # volumes long syntax
  2. # options to share host's x-server:
  3. # - Xephyr
  4. # - pass $XAUTHORITY (insecure, https://stackoverflow.com/a/25280523/5894777)
  5. # - xhost + (horribly insecure)
  6. volumes:
  7. home:
  8. services:
  9. browser:
  10. build: .
  11. image: docker.io/fphammerle/brave-browser
  12. container_name: brave_browser
  13. init: true
  14. environment:
  15. - DISPLAY
  16. read_only: true
  17. volumes:
  18. - type: bind
  19. source: /tmp/.X11-unix
  20. target: /tmp/.X11-unix
  21. - type: volume
  22. source: home
  23. target: /home/browser
  24. - type: tmpfs
  25. # > ERROR:chrome_browser_main.cc(1254)] Failed to create a ProcessSingleton for your profile directory. [...]
  26. target: /tmp
  27. tmpfs:
  28. # nosuid,nodev,noexec added by default
  29. mode: '1777'
  30. size: 4k
  31. # fix some "Aw, Snap!" errors (including video playback)
  32. # > ERROR:broker_posix.cc(46)] Received unexpected number of handles
  33. # default:
  34. # > $ sudo docker exec brave_browser mount | grep /dev/shm
  35. # > shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
  36. # https://github.com/puppeteer/puppeteer/blob/v7.1.0/docs/troubleshooting.md#tips
  37. shm_size: 1GB
  38. cap_drop: [ALL]
  39. security_opt: [no-new-privileges]
  40. # https://docs.docker.com/compose/compose-file/compose-file-v2/