Use nginx in docker to serve static files

December 01, 2020 docker nginx

Not sure how practical this really is but I thought it was neat. Run nginx and tell it to serve some static content on your system.

docker run --name static-nginx -p 8080:80 -v /d/path/to/my/files:/usr/share/nginx/html:ro -d nginx

/d/path/to/my/files/ is the syntax to use if you're running docker on WSL 2.