Sign inSign up

weldpua2008/nginx

By weldpua2008

Updated over 10 years ago

Docker Image to run Nginx server optimized for maximum performance

Image
1

2.2K

weldpua2008/nginx repository overview

dockeri.co

Docker Pulls Docker Stars GitHub issues GitHub forks GitHub stars GitHub license

Docker-nginx

Docker Image to run Nginx server

Usage

To create the image weldpua2008/nginx, execute the following command on the weldpua2008-docker-nginx folder:

docker build -t weldpua2008/nginx .

Running your Nginx docker image

Start your image building the external ports 80 in all interfaces to your container:

docker run -d -p 80:80 weldpua2008/nginx

Test your deployment:

curl http://localhost/

Hello world!

Loading your custom PHP application

In order to replace the "Hello World" application that comes bundled with this docker images, first create a new empty folder. Go to the new folder and create two subfolders: sites-enabled and app. Copy your configuration files to sites-enabled and you application files to app. Then create a new Dockerfile with the following contents:

FROM weldpua2008/nginx
ADD sites-enabled/ /etc/nginx/sites-enabled/
ADD app/ /app/
RUN chown -R www-data:www-data /app/
EXPOSE 80

Remember to put your configuration files under the folder named sites-enabled and your website files under the folder app. Also, if you want to use a different port, change the EXPOSE 80 in Dockerfile as well.(eg. EXPOSE 443 80 will allow connections go through port 443 and 80). After that, build the new Dockerfile:

docker build -t username/my-nginx

And test it:

docker run -d -P username/my-nginx

Test your deployment:

curl http://localhost/

That's it!

Tag summary

Content type

Image

Digest

Size

67.9 MB

Last updated

over 10 years ago

docker pull weldpua2008/nginx