Running Nginx with Docker
The official nginx image serves content out of the box. docker run -d --name nginx -p 8080:80 nginx runs a detached container and maps container port 80 to host port 8080; browse http://localhost:8080.
Serving your own site
Mount a directory over the default document root: -v $(pwd)/site:/usr/share/nginx/html:ro. The container picks up the files immediately — no rebuild needed for static content.
Custom configuration
Mount your own config with -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro. After editing it, apply changes without restarting via docker exec nginx nginx -s reload.