Docker-nginx

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:

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: