I run Firefox inside a systemd-nspawn[0] container. I wrote a little wrapper around systemd-nspawn that I call arch-lwc[1] which kinda mimics the docker CLI. I have another script to coordinate the Firefox-specific stuff.
[0]: https://wiki.archlinux.org/title/Systemd-nspawn
[1]: https://github.com/b0o/arch-lwc