We've built a minimal dockerized example of using the Lua SDK with OpenResty NGINX framework. For more comprehensive instructions, you can visit the Using the Lua SDK with NGINX guide or the Lua reference guide.
- On the command line from the root of the repo, build the image from this directory with
docker build -t hello-nginx -f ./examples/hello-nginx/Dockerfile .
. - Run the demo with
docker run --rm --name hello-nginx -p 8123:80 --env LAUNCHDARKLY_SDK_KEY="my-sdk-key" --env LAUNCHDARKLY_FLAG_KEY="my-boolean-flag" hello-nginx
- Note: the SDK key and flag key are passed with environment variables into the container. The
LAUNCHDARKLY_FLAG_KEY
should be a boolean-type flag in your environment. - Open
localhost:8123
in your browser. Toggle the flag on to see a change in the page (refresh the page.)
You should receive the message:
The (flag key) feature flag evaluates to (true/false).