This commit is contained in:
PB
2025-11-23 21:49:48 +01:00
parent 214889a1a5
commit e2834e1a7a
4 changed files with 209 additions and 41 deletions

View File

@@ -1,4 +1,30 @@
FROM 1.28.0-alpine3.21
FROM openresty/openresty:alpine AS builder
RUN apk add --no-cache lua5.4 lua5.4-dev luajit luarocks build-base openssl-dev \
pcre-dev zlib-dev git && \
luarocks-5.4 install lua-resty-core && \
luarocks-5.4 install lua-resty-jwt && \
luarocks-5.4 install lua-resty-http && \
luarocks-5.4 install lua-cjson
RUN git clone https://github.com/facebook/luaffifb && \
cd luaffifb && \
luarocks-5.4 make
RUN mkdir -p /lua_modules/cjson && mkdir -p /lua_modules/resty && \
cp -r /usr/local/share/lua/5.4/resty/* /lua_modules/resty && \
# cp /usr/local/share/lua/5.4/resty/evp.lua /lua_modules/resty/ && \
# cp /usr/local/share/lua/5.4/resty/evp.lua /lua_modules/resty.evp.lua && \
cp -r /usr/local/share/lua/5.4/cjson/* /lua_modules/cjson && \
cp -r /usr/local/lib/lua/5.4/* /lua_modules/ && \
# cp -r /usr/local/share/lua/5.4/resty/* /lua_modules/ && \
ls -lah /lua_modules
# RUN ls -lah /usr/local/share/lua/5.4/cjson
# RUN ls -lah /usr/local/share/lua/5.4/resty
# RUN ls -lah /usr/local/lib/lua/5.4/
FROM haproxytech/kubernetes-ingress:latest
ARG BUILD_TIME
@@ -8,9 +34,11 @@ LABEL dev.egommerce.image.service="api-gateway"
LABEL dev.egommerce.image.version="1.0"
LABEL dev.egommerce.image.build_time=${BUILD_TIME}
# COPY ./api-gateway/etc /etc/traefik
# COPY --from=builder /usr/local/lib/lua/5.4/cjson.so /usr/local/lib/lua/5.4/cjson.so
COPY --from=builder /lua_modules /usr/local/lib/lua/5.4/
# ENTRYPOINT ["/entrypoint.sh"]
# CMD ["traefik"]
COPY ./api-gateway/etc/haproxy-aux.cfg /usr/local/etc/haproxy/haproxy-aux.cfg
COPY ./api-gateway/*.lua /usr/local/etc/haproxy/lua/
# COPY ./api-gateway/jwt_auth.lua /usr/local/etc/haproxy/lua/jwt_auth.lua
EXPOSE 443
EXPOSE 8443