Installs NGINX into a Linux container

Several tag are available:
Nginx is software to provide a web server. It can act as a reverse proxy server for TCP, UDP, HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache.
docker create --name=nginx \
-v /etc/localtime:/etc/localtime:ro \
-v <path to webroot>:/var/www/html/default \
-v <path to nginx logs>:/var/log/nginx \
-e DOCKUID=<UID default:10002> \
-e DOCKGID=<GID default:10002> \
-e DOCKPHPFPMURL=<url-to-php-fpm default:php-fpm:9000> \
-e DOCKFCGIURL=<url-to-fastcgi default:fcgi:9001> \
-e DOCKSSL=<0|1 default:0> \
-e DOCKUPSTREAMURL=<url-to-upstream default:myupstream:80> \
-e DOCKVHOST<default|php|symfony3-dev|symfony3-prd|symfony4|angular|grav|fcgi|nextcloud|proxy|spotweb|mediawiki|custom default:default>
-p 80:80 \
-p 443:443 docker/docker-nginx
When you start the nginx image, you can adjust the configuration of the nginx instance by passing one or more environment variables on the docker run command line.
DOCKUIDThis variable is not mandatory and specifies the user id that will be set to run the application. It has default value 10002.
DOCKGIDThis variable is not mandatory and specifies the group id that will be set to run the application. It has default value 10002.
DOCKPHPFPMURLThis variable is not mandatory and specifies the URL of a PHP FPM server. It has default value php-fpm:9000.
DOCKFCGIURLThis variable is not mandatory and specifies the URL of a FastCGI server. It has default value fcgi:9001.
DOCKUPSTREAMURLThis variable is not mandatory and specifies the URL of a webservice to proxy. It has default value myupstream:80.
DOCKSSLThis variable is not mandatory and specifies if the configured vhost will serve through https or http. It has default value 0.
DOCKVHOSTThis variable is not mandatory and specifies to the entrypoint which vhost to configure. Valid values are default, php, symfony3-dev, symfony3-prd, symfony4, angular, grav, fcgi, nextcloud, proxy, spotweb or custom. It has default value default.
default will configure a vhost to serve static files.php will configure a vhost that support php-fpm.symfony3-prd will configure a vhost with support for symfony 3 production environment.symfony3-dev will configure a vhost with support for symfony 3 development environment.symfony4 will configure a vhost with support for symfony 4 environment.angular will configure a vhost with support for angular.grav will configure a vhost with support for grav CMS.fcgi will configure a vhost with support for FastCGI like spawn-fcgi.nextcloud will configure a vhost with support for Nextcloud.proxy will configure a vhost that will allow to proxy a given host and port.spotweb will configure a vhost with support for Spotweb.mediawiki will configure a vhost with support for Mediawiki Short URLs.custom will configure a vhost from a provided vhost config file /docker-entrypoint.d/07-custom-http(s).confDOCKSSL.-e DOCKPHPFPMURL=<url-to-php-fpm> at container creation.DOCKSSL will result to let the entrypoint configure nginx with a regular vhost without SSL support.DOCKVHOST will result to let the entrypoint configure nginx with a regular vhost without support php-fpm.Content type
Image
Digest
sha256:b690734a6…
Size
5.6 MB
Last updated
4 days ago
docker pull digrouz/nginx