No description
Find a file
2021-02-06 14:57:25 +01:00
.gitignore Updated gitignore. 2021-02-06 14:05:10 +01:00
Dockerfile Add LABEL to dockerfile. 2021-02-05 15:39:43 +01:00
environment_variables.txt Init commit. 2021-02-05 15:13:20 +01:00
readme.md added readme.md. 2021-02-06 14:57:25 +01:00
start-nginx.sh Fix envsubst step. 2021-02-05 15:58:46 +01:00

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

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