How to serve a custom index.html using the stock nginx docker image?
The &quot;official&quot; nginx image has a specific path where it looks for files. You can either copy a file into the image by creating a new image from it or mount your files into this path as a volume.
To copy files, have a folder with your index.html and a Dockerfile that looks like this:
FROM nginx
COPY index.html /usr/share/nginx/html

Then build a new image with docker build -t my-nginx .
To start a container with your own files as a volume, you can run the container like this:
docker run -p 8080:80 -v ${PWD}:/usr/share/nginx/html nginx

All the files in your current folder (including the index.html) will now be available via http://localhost:8080/index.html.
Most of this information is covered in the documentation for the image at https://hub.docker.com/_/nginx