- Build the image
docker build -t mini-project-3 .
- The
CMD ["nginx", "-g", "daemon on;"] && tail -f /dev/null
in the Dockerfile tells Docker to start the Nginx process with thedaemon on;
option, and then execute thetail
command to keep the container running. Thetail
command will output nothing (because it's reading from/dev/null
), but it will keep the container running until it's manually stopped.