Docker WebApp Nginx Required or Not

Hi All,

I am new to docker and have a query.

In the scenario of deployment what I used to do is to configure the WebApp on IIS or Nginx

In the various tutorials over the web, I have seen the author creates an image and runs it.

Can anybody suggest me how it works in the real world? Do we need to configure Nginx as a separate image or make it part of the same image as the application or we don’t need to have it while hosting a web app?

Looking forward to the response.

It will be nice if anyone can suggest a good practical example from localhost to deployment on cloud or vps.

Hellor @manojsethi

You can launch an instance of NGINX running in a container and using the default NGINX configuration. As SSH cannot be used to access the NGINX container, to edit the content or configuration files directly you need to create a helper container that has shell access. For the helper container to have access to the files, create a new image that has the proper Docker data volumes defined for the image
An example for doing that is by copying nginx content and configuration files and define the volume for the image with the Dockerfile as the following:

FROM nginx
COPY content /usr/share/nginx/html
COPY conf /etc/nginx
VOLUME /usr/share/nginx/html
VOLUME /etc/nginx