Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the best docker image for nginx and nginx plus?


Asked by Madilynn Cherry on Dec 08, 2021 Nginx Getting started



As software applications, NGINX Open Source and NGINX Plus are great use cases for Docker, and we publish an NGINX Open Source image on Docker Hub, the repository of Docker images. This article describes how you can deploy NGINX Open Source using this image from Docker Hub, and create and deploy your own Docker image of NGINX Plus.
In respect to this,
Creating a Docker Image of NGINX Plus. To generate an NGINX Plus image, first create a Dockerfile. The example we provide here uses Debian 9 (Stretch) as the base Docker image. Before you can create the NGINX Plus Docker image, you have to download your version of the nginx-repo.crt and nginx-repo.key files.
Additionally, The Docker Swarm load balancer forwards client requests to NGINX Plus for load balancing among service instances. Similarly, the Swarm load balancer receives interservice requests but NGINX Plus actually distributes them among the services (Figure 7).
Next,
We will use Docker to run Next.js and NGINX in separate containers and have NGINX cache static assets. If you don’t already have a Next.js app, we’ll create a very basic one first. No Docker Compose? I will assume that you have that you are familiar with the basics of Docker and have it up and running on your machine.
Also Know,
Because the NGINX image also uses Debian (and all of our examples so far use the NGINX image), it is most efficient to use Debian for the helper container, rather than having Docker load another operating system.