From 1bf5b11835d0ad3147abe4007e461bcc9dfe0aa5 Mon Sep 17 00:00:00 2001 From: redxef Date: Sat, 6 Feb 2021 14:57:25 +0100 Subject: [PATCH] added readme.md. --- readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..4f017de --- /dev/null +++ b/readme.md @@ -0,0 +1,26 @@ +# nginx-envsubst + +A simple docker image for configuring nginx with environment variables. + +## Usage +This image does not ship with a default configuration. +To get started place your nginx config in `/etc/nginx/nginx.conf` +and your normal server configurations in `/etc/nginx/sites-enabled/`. + +Every configuration file in `/etc/nginx/sites-available/` will get +passed to `envsubst` and written to `/etc/nginx/sites-enabled/`. + +To specify which variables to substitute place a file +`/environment_variables.txt` in the docker container with all variables +which should be passed to envsubst. + +## Minimal Example + +```sh +docker run \ + -v "$PWD/nginx.conf":/etc/nginx/nginx.conf \ + -v "$PWD/server.conf":/etc/nginx/sites-available/server.conf \ + -v "$PWD/index.html":/var/www/html/index.html \ + -e DOMAIN_NAME=localhost -p 80:80 \ + redxef/nginx-envsubst:latest +```