nginx-envsubst/readme.md

28 lines
776 B
Markdown
Raw Permalink Normal View History

2021-02-06 14:57:25 +01:00
# nginx-envsubst
A simple docker image for configuring nginx with environment variables.
## Usage
2022-03-09 03:04:45 +01:00
Mount you whole nginx configuration into `/etc/nginx.tmpl/`.
2022-03-07 17:58:18 +01:00
The configuration files can contain environment variables compatible
with `envsubst`, list these variables in a file `/etc/envsubst.conf`.
Additionally, the server gets reloaded when a update to one of the
referenced certificates happens.
2021-02-06 14:57:25 +01:00
## Minimal Example
```sh
2022-03-07 17:58:18 +01:00
cd example
docker run --rm -it \
-e DOMAIN_NAME=localhost \
-p 80:80 -p 443:443 \
2022-03-07 17:58:18 +01:00
-v "$PWD/nginx.conf:/etc/nginx.tmpl/nginx.conf" \
-v "$PWD/envsubst.conf:/etc/envsubst.conf" \
-v "$PWD/cert:/cert" \
redxef/nginx-envsubst
2021-02-06 14:57:25 +01:00
```
2021-02-06 16:08:11 +01:00
## Source
2022-03-07 18:04:44 +01:00
[gitea.redxef.at/redxef/nginx-envsubst](https://gitea.redxef.at/redxef/nginx-envsubst)