How I could restart the web server in docker

doing so will restart the entire docker container. what I trying to do is to restart the web server without touch the container, such as using “rails server” and then stop it without utilizing docker.