From 3e452621fc7a22574ab48a654a57136c1ce4b645 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Wed, 23 Feb 2022 16:45:17 +0100 Subject: [PATCH] chore(nginx): extended LB abilities Signed-off-by: rjshrjndrn --- scripts/dockerfiles/nginx/Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/dockerfiles/nginx/Dockerfile b/scripts/dockerfiles/nginx/Dockerfile index dd3414240..53da15731 100644 --- a/scripts/dockerfiles/nginx/Dockerfile +++ b/scripts/dockerfiles/nginx/Dockerfile @@ -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