Sign inSign up

estebanmatias92/nginx

By estebanmatias92

•Updated over 8 years ago

Image
0

1.4K

estebanmatias92/nginx repository overview

  •  [`latest` (*Dockerfile*)](https://github.com/estebanmatias92/docker-nginx/blob/master/Dockerfile)
    

⁠What contains this image?

  •  [Official Docker nginx image](https://registry.hub.docker.com/_/nginx)
    
  •  [Dockerize](https://github.com/jwilder/dockerize)
    

⁠How to use this image

⁠Traditional way

   docker run -d estebanmatias92/nginx

With this, you have a nginx server that runs on port 80 from the container ip.

⁠Dockerize way

With Dockerize you can redirect logs to Docker log collector and easily manage any configuration at runtime through templates and environment variables.

Before start to using it, i recommend you to read the Jason Wilder’s post⁠ for a more in-depth explanation about this tool.

   FROM estebanmatias92/nginx
   COPY ./config/nginx.conf /etc/nginx/
   COPY ./config/default.tmpl /var/www/config/
   RUN mkdir -p /etc/nginx/sites-enabled/
   ENTRYPOINT [“dockerize”, “-template”, “/var/www/config/default.tmpl:/etc/nginx/sites-enabled/default”, “-stdout”, “/var/log/nginx/access.log”, “-stderr”, “/var/log/nginx/error.log”, “/usr/sbin/nginx”]
   CMD ["-g", "daemon off;"]

If the template that you copied had some placeholder to replace, you can make usage of it:

   docker build --force-rm -t my-nginx-image .
   docker run -d --link=”php-container:php” -e FASTCGI_ADDRESS=php:9000 my-nginx-image

And you have a nginx server linked with a php server from another container.

In the example above i assume that you made a placeholder for “fastcgi_pass” option (fastcgi_pass={{ .Env.FASTCGI_ADDRESS }}), but you can create this way whatever environment variable that you want.

⁠License

View license information⁠ for nginx.

View license information⁠ for dockerize.

⁠User Feedback

⁠Issues

If you have any problems with or questions about this image, please contact me through a GitHub issue⁠.

⁠Contributing

Every contribution are welcome.

Tag summary

Content type

Image

Digest

sha256:7b43cdef4…

Size

43.9 MB

Last updated

over 8 years ago

docker pull estebanmatias92/nginx