Build the image with Dockerfile and use docker to serve the static content to the application.
- Docker
$ docker build -t node-docker .
# -t -> sets the tag to the image with memorable name
# . -> tells the build context is current directory
$ docker run --name node-docker -p 80:8080 -d node-docker
# --name -> sets the name of the container
# -p 80:8080 -> publishes the port 8080 of the container and maps to the host port 8080, so that the traffic on host port 8080 is routed to the container
# -d -> runs the container in detached mode. i.e in background
$ docker ps or docker container ls(new)
# it shows active containers only.
# use flag -a or --all to list all containers
$ docker images
# use flag -a or --all to list all containers
$ docker container rm or docker rm
$ docker image rm
# use -f to force remove running container
$ docker system prune -a
$ docker push imageName
$ docker pull imageName