I had an issue recently with getting FileBrowser to run and while researching that, I found this tool which creates a docker-compose.yml file from a docker run command. It worked well for me, so I am passing it along to you all. I hope someone else finds this helpful.
(Not my tool / site, to be clear)
I use Dockge (in addition to portainer as a ‘something went sideways and I need more capabilities’), which has this ability built-in. It’s quite nice.