feat(lua-client): 新增 Lua 客户端 SDK 及示例

This commit is contained in:
2026-07-20 21:18:35 +08:00
parent 881c9319df
commit 295de72308
11 changed files with 1390 additions and 4 deletions
+39
View File
@@ -0,0 +1,39 @@
# Build stage
FROM lua:5.4 AS build
WORKDIR /src
# Install build dependencies
RUN apk add --no-cache git
# Copy client library
COPY kenaito-conf-lua-client/ ./kenaito-conf-lua-client/
# Install Lua dependencies
WORKDIR /src/kenaito-conf-lua-client
RUN luarocks install luasocket && \
luarocks install dkjson
# Copy demo project
WORKDIR /src
COPY kenaito-conf-lua-client-demo/ ./kenaito-conf-lua-client-demo/
# Runtime stage
FROM lua:5.4
WORKDIR /app
# Copy Lua modules from build stage
COPY --from=build /usr/local/share/lua/5.4 /usr/local/share/lua/5.4
COPY --from=build /usr/local/lib/lua/5.4 /usr/local/lib/lua/5.4
# Copy client library
COPY --from=build /src/kenaito-conf-lua-client/kenaito_conf /app/kenaito_conf
# Copy demo
COPY --from=build /src/kenaito-conf-lua-client-demo/app.lua /app/app.lua
ENV LUA_PATH="/app/?.lua;/usr/local/share/lua/5.4/?.lua;;"
ENV LUA_CPATH="/usr/local/lib/lua/5.4/?.so;;"
ENTRYPOINT ["lua", "app.lua"]