Public | Automated Build

Last pushed: a year ago
Short Description
NGinx docker images
Full Description

nginx

Mounting

To mount this image, execute the following command inside this folder:

docker build -t nginx .

Serving

Just execute the following command line to execute nginx image on port 80.

docker run --name nginx -p 80:80 -v /path/to/your/www:/var/www -d nginx

Working with PHP

This image expects PHP to be a running container aliased as php so to use it, you need to set
the link on run:

docker run --name nginx -p 80:80 -v /path/to/your/www:/var/www --link php:php -d nginx

Working with pre-made configuration files

This image comes with pre-made configuration files for nginx:

All you need to do is to set an environment variable called CONF:

docker run --name nginx -p 80:80 -v /path/to/your/www:/var/www -e CONF=wordpress -d nginx

For now, the following configuration are available:

  • symfony2
  • wordpress

Set-up a server name

You can set-up a server name by adding SERVER_NAME environment variable:

docker run --name nginx -p 80:80 -v /path/to/your/www:/var/www -e SERVER_NAME=conrad-caine.com -d nginx

PS.: Ensure you have set-up this server in your host file and try to access it into your browser.

Using it with compose

nginx:
    image: nginx
    environment:
        CONF: symfony2
        SERVER_NAME: dev.website.com
        PORT: 80
    links:
        - php
    ports:
        - 80:80

Logging

You can follow nginx container log by executing:

docker logs -f nginx
Docker Pull Command
Owner
alcmoraes
Source Repository