chore(nginx): extended LB abilities

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2022-02-23 16:45:17 +01:00
parent 729829097e
commit 3e452621fc

View file

@ -1,9 +1,23 @@
# Ability to add sticky sessions using any parameters
FROM openresty/openresty:buster as builder
workdir /work
ADD https://github.com/openresty/lua-resty-balancer/archive/refs/heads/master.tar.gz .
RUN apt update && \
apt install gcc make -y && \
tar -xf master.tar.gz && \
cd lua-resty-balancer-master && \
make
FROM openresty/openresty:buster
# Adding prometheus monitoring support
ADD https://raw.githubusercontent.com/knyar/nginx-lua-prometheus/master/prometheus.lua /usr/local/openresty/lualib/
ADD https://raw.githubusercontent.com/knyar/nginx-lua-prometheus/master/prometheus_keys.lua /usr/local/openresty/lualib/
ADD https://raw.githubusercontent.com/knyar/nginx-lua-prometheus/master/prometheus_resty_counter.lua /usr/local/openresty/lualib/
COPY --from=builder /work/lua-resty-balancer-master/*.so /usr/local/openresty/lualib/lua-resty-chash/
COPY --from=builder /work/lua-resty-balancer-master/lib /usr/local/openresty/lualib/lua-resty-chash/lib/
RUN chmod 0644 /usr/local/openresty/lualib/*.lua
# Enabling monitoring on port 9145