Git Product home page Git Product logo

nginx-docker-env's Introduction

What is it?

It's a container that packages an nginx server with bindings for running Lua scripts and the Lua DKJSON library. When you have a project where you need to serve some application that needs access to the environment variables of the container then you can use this container to quickly do that.

How to use it?

The entrypoint script of the container checks the environment variables and expects to discover a special variable with the name NGINX_ENV_VARS. The value of this variable should be a comma-separated list contianing the names of all the environment variables that you want to have access to.

For example, if you want to load the variables ENV1=bla and ENV2=blabla to the environemnt of the container and make them accessible from the outside then you should set NGINX_ENV_VARS="ENV1,ENV2".

You do not need to do anything else, the entrypoint will take care of the rest during the container startup.

In your nginx configuration you must also include the following:

location /env {                                                                                             
    content_by_lua_file /usr/local/openresty/nginx/lua/serve_vars.lua;                                      
}

This /env endpoint is the one that you need to call with a GET request to get the json document with the environment variables that you have loaded to the container.

nginx-docker-env's People

Contributors

ptzianos avatar signalkraft avatar tech4242 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nginx-docker-env's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.