Dockerfile is a text file that lays out, as instructions, which base image a Docker image starts from, which files get copied in, which commands get run, and what command runs when the container starts. The file name is written as Dockerfile with no extension.
dockerfile
# Create a file named Dockerfile
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
COPY index.html .
EXPOSE 80FROM sets the base image. WORKDIR picks the working folder inside the container. COPY copies your local index.html into the Nginx web root. EXPOSE documents that the container will use port 80.
You should see
Once you build and run this Dockerfile, you'll be able to see your index.html in the browser, served through Nginx.Info
EXPOSE doesn't automatically give you access from the host computer. To reach it from a browser, you still need to map the port with docker run -p 8080:80.