fabiocicerchia / nginx-lua

Latest Nginx with LUA support based on AlmaLinux, Alpine Linux, Amazon Linux, Debian, Fedora, and Ubuntu.
https://hub.docker.com/r/fabiocicerchia/nginx-lua
Other
191 stars 42 forks source link

json parsing #140

Closed xivanc closed 5 months ago

xivanc commented 10 months ago

Is your feature request related to a problem? Please describe. I have not been able to find out which of the existing lua modules in this repo can be used for json parsing.

Describe the solution you'd like If the json parsing feature is not supported by any of the existing modules, ideally if some standard and battle-tested module would be included, like https://github.com/rxi/json.lua or https://github.com/mpx/lua-cjson or sth similar.

fabiocicerchia commented 10 months ago

Hi @xivanc, could you try with this lua-cjson module (installable via luarocks)? Would it work for you?

xivanc commented 10 months ago

@fabiocicerchia Thanks for the answer. Yes, installing it explicitly into an already running docker image with the command luarocks install lua-cjson works. I just wanted to avoid explicitly running this command after the docker is initialised. If I want to have it out of the box, perhaps the best way for me would be to update docker entrypoint and build my custom version of the image from this repo?

fabiocicerchia commented 9 months ago

@xivanc you could try something like this, which allows you to further customise the image:

FROM fabiocicerchia/nginx-lua:latest

RUN luarocks install lua-cjson

# more commands / settings if needed