45 lines
1.7 KiB
Docker
45 lines
1.7 KiB
Docker
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
|
|
|
|
LABEL dev.egommerce.image.author="Piotr Biernat"
|
|
LABEL dev.egommerce.image.vendor="Egommerce"
|
|
LABEL dev.egommerce.image.service="api-gateway"
|
|
LABEL dev.egommerce.image.version="1.0"
|
|
LABEL dev.egommerce.image.build_time=${BUILD_TIME}
|
|
|
|
# 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/
|
|
|
|
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 8443
|