A Docker image for running [nginx][nginx], based on Alpine Linux. This image belongs to a suite of images [documented here][dockeralpine].
| Registry | Public | Path |
|---|---|---|
| hub.docker.com | Y | bcgdv/alpine-nginx |
| gitlab.com | N | bcgdv/alpine-nginx |
| gitlab.bcgdv.io | N | dev-ops/alpine-nginx |
This image features:
To use this image include FROM bcgdv/alpine-nginx at the top of your Dockerfile, or simply docker run -p 8000:80 --name nginx bcgdv/alpine-nginx.
Nginx logs (access and error logs) aren't automatically streamed to stdout and stderr. To review the logs, you can do one of two things:
Run the following in another terminal window:
docker exec -i nginx tail -f /var/log/nginx/access.log -f /var/log/nginx/error.log
or, in your Dockerfile symlink the Nginx logs to stdout and stderr:
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
This container comes setup as follows:
To alter the HTML content that nginx serves up (add your website files), add the following to your Dockerfile:
ADD /path/to/content /var/www
index.html is the default, but that's easily changed (see below).
A basic nginx configuration is supplied with this image. But it's easy to overwrite:
default.conf.Dockerfile, make sure your default.conf file is copied to /etc/nginx/conf.d/default.conf.Make sure you start nginx without daemon mode, by including daemon off; in your nginx configuration, otherwise the container will constantly exit right after nginx starts.
If you're running another process to keep track of something down-stream (for example, automatically updating [nginx][nginx] proxy settings when a down-stream application server (nodejs, php, etc) restarts) execute the command s6-svc -h /var/run/s6/services/nginx to send a SIGHUP to nginx and have it reload its configuration, launch new worker process(es) using this new configuration, while gracefully shutting down the old worker processes.
https://github.com/smebberson/docker-alpine http://nginx.org/ https://github.com/smebberson/docker-alpine/tree/master/examples/user-nginx https://github.com/BCGDV/nginx-upstream-dynamic-servers
Content type
Image
Digest
Size
66.6 MB
Last updated
about 9 years ago
docker pull bcgdv/alpine-nginx