Our Dockerfile contains the receipt to build a Docker image with all the configuration we need to start our NGINX web server and also will contain the web application that has to be copied inside the container. Go ahead and create the Dockerfile file in the project root folder:
FROM nginx:alpineCOPY default.conf /etc/nginx/conf.d/default.confCOPY index.html /usr/share/nginx/html/index.htmlCOPY dist /usr/share/nginx/html/scripts
Yeah, that's all! This is a simple Docker file that uses nginx:alphine as its base image. We COPY the default.conf file, which contains the NGINX configuration file, and, finally, we COPY our web application files.
That's it! let's build our Docker image and run our very first container.