Serve content w/ a highly customizable Nginx server; designed for use w/ AWS ElasticBeanstalk! :P
50K+
Serve content with a highly customizable Nginx server; designed for use with AWS ElasticBeanstalk! :P
This is a minimal Docker image for running Nginx in a highly customizable manner, by making use of a bash script with hooks as the container's run command. It's meant primarily as a workaround for AWS ElasticBeanstalk's lack of a way to specify a run command for a Docker container, and is designed for all hosted content and configuration files to be provided via mounted directories.
docker pull vixlet/nginx:latest### RUN CONTAINER INTERACTIVELY
docker run -it --rm \
-p 80:80 \
-v $( pwd ):/var/app \
-v $( pwd )/conf.d:/etc/nginx/conf.d \
--name "vixlet-nginx-example" \
vixlet/nginx:latest
### RUN CONTAINER IN THE BACKGROUND
docker run -d \
-p 80:80 \
-v $( pwd ):/var/app \
-v $( pwd )/conf.d:/etc/nginx/conf.d \
--name "vixlet-nginx-example" \
vixlet/nginx:latest
### RUN CONTAINER IN THE BACKGROUND FOR LOCAL DEVELOPMENT
docker run -d \
-p 80:80 \
-v $( pwd ):/var/app \
-v $( pwd )/conf.d:/etc/nginx/conf.d \
-e "DOCKER_WATCH=on" \
--name "vixlet-nginx-example" \
vixlet/nginx:latest
Mount a directory containing your Nginx site configuration files to either /etc/nginx/conf.d or /etc/nginx/sites-enabled.
Nginx loads the configuration files in the following order:
/etc/nginx/conf.d/*.conf/etc/nginx/sites-enabled/*.confA custom pre-start script can be provided to handle any pre-start tasks (such as rewriting Nginx configuration files with environment variable values, which can only be done at run-time).
Note that any pre-start script must not start any other persistent processes or invoke Nginx itself!
To use a custom pre-start script, simply provide an executable file in your working directory named docker-prestart.sh (or set the DOCKER_PRESTART_SCRIPT environment variable to the filepath of the desired script) and the Docker container will automatically invoke it immediately prior to starting the Nginx process.
DOCKER_PRESTART_SCRIPT"/var/app/docker-prestart.sh"DOCKER_WATCHgulp watch); disables sendfile, tcp_nopush, and tcp_nodelay directives"""on"© 2014, 2015 VIXLET CA LLC [email protected]
The “ISC” license:
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Content type
Image
Digest
sha256:4f2c5749b…
Size
52.2 MB
Last updated
about 11 years ago
docker pull vixlet/nginx