From 87f15547371af2900cbb4f995b5a24131592a76f Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 27 Jun 2018 18:08:56 +0000 Subject: [PATCH] Run update.sh --- nginx/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx/README.md b/nginx/README.md index 96ccadac3..683f88a95 100644 --- a/nginx/README.md +++ b/nginx/README.md @@ -145,6 +145,16 @@ The `mysite.template` file may then contain variable references like this: `listen ${NGINX_PORT}; ` +## Running nginx in read-only mode + +To run nginx in read-only mode, you will need to mount a Docker volume to every location where nginx writes information. The default nginx configuration requires write access to `/var/cache` and `/var/run`. This can be easily accomplished by running nginx as follows: + +```console +$ docker run -d -p 80:80 --read-only -v $(pwd)/nginx-cache:/var/cache/nginx -v $(pwd)/nginx-pid:/var/run nginx +``` + +If you have a more advanced configuration that requires nginx to write to other locations, simply add more volume mounts to those locations. + ## Running nginx in debug mode Images since version 1.9.8 come with `nginx-debug` binary that produces verbose output when using higher log levels. It can be used with simple CMD substitution: