Docker - Restart Docker container automatically if it crashed

Restart container when it crashes

docker run --name nginx-con --restart=always

--restart=always - will cause the container to automatically restart, in case the nginx daemon running inside it would crash or segfault.