Check out this post on how to keep a Docker container running in your Docker environment.
https://kodekloud.com/blog/keep-docker-container-running/