Dockge is a wonderful program for managing Docker containers. It utilizes Docker Compose files to do so and I have quite a few containers that are run from either command line or Portainer. This is how to convert from a running container to Docker Compose.
- Ensure container is running
- Run this command to get the container ID: docker container list
- Run this command to get the actual Docker Run command of the container: docker inspect --format "$(curl -s https://www.strav.net/docker/run.tpl)" <container id>
- Go to this site and paste the Docker Run command in the first box to create the Docker Compose command: https://www.composerize.com/