Sign inSign up

rainu/nginx

By rainu

Updated about 7 years ago

nginx - configfiles via env variables

Image
0

291

rainu/nginx repository overview

docker-nginx

If you only want to add a config-file into the official nginx docker image you have to make your own Dockerfile and add a such config-file. This annoys me! So i have made this docker image. Here you can define (config) files inside the environment variables!

The following docker command will create the file:

/etc/nginx/conf.d/global.conf

client_max_body_size 512M;
client_body_buffer_size 128M;
docker run \
  -e "CFG_0_FILE=/etc/nginx/conf.d/global.conf" \
  -e "CFG_0_CONTENT_0=client_max_body_size 512M;" \
  -e "CFG_0_CONTENT_1=client_body_buffer_size 128M;" \
  rainu/nginx

Documentation

VariableRequiredDescription
CFG_N_FILEtrueThe target file path
CFG_N_MODfalseThe chmod-mode for the file
CFG_N_OWNERfalseThe chown user and or group (delimited by ":" ) for the file
CFG_N_CONTENT_MtrueThe content of the file.

You can define multiple files! The file-env-variables is grouped by the N inside the variables.

Tag summary

Content type

Image

Digest

Size

48.3 MB

Last updated

about 7 years ago

docker pull rainu/nginx