From 6b9c345c77bfdf267e82066dd87fa627381f6eca Mon Sep 17 00:00:00 2001 From: danilapog Date: Thu, 12 Dec 2024 06:35:25 +0000 Subject: [PATCH] Add the ability for the balancer to work with sentinel Co-authored-by: danilapog Co-committed-by: danilapog --- Dockerfile | 12 ++---------- Dockerfile.balancer | 1 + Dockerfile.noplugins | 12 ++---------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a04ad4..d94221e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,19 +14,17 @@ ENV COMPANY_NAME=$COMPANY_NAME \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver -RUN yum install sudo -y && \ +RUN yum install sudo python3-pip -y && \ yum install shadow-utils -y && \ amazon-linux-extras install epel -y && \ yum install procps-ng tar wget -y && \ + pip3 install redis && \ wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_$(uname -m) && \ chmod +x /usr/local/bin/dumb-init && \ groupadd --system --gid 101 ds && \ useradd --system -g ds --no-create-home --shell /sbin/nologin --uid 101 ds && \ rm -f /var/log/*log -FROM python:2.7 AS redis-lib -RUN pip install redis==3.5.3 - FROM ds-base AS ds-service ARG TARGETARCH ARG DS_VERSION_HASH @@ -173,12 +171,6 @@ COPY --chown=ds:ds --from=ds-service \ COPY --from=ds-service \ /var/www/$COMPANY_NAME/documentserver/document-templates/new \ /var/www/$COMPANY_NAME/documentserver/document-templates/new -COPY --from=redis-lib \ - /usr/local/lib/python2.7/site-packages/redis \ - /usr/lib/python2.7/site-packages/redis -COPY --from=redis-lib \ - /usr/local/lib/python2.7/site-packages/redis-3.5.3.dist-info \ - /usr/lib/python2.7/site-packages/redis-3.5.3.dist-info COPY docker-entrypoint.sh /usr/local/bin/ USER ds ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/DocService/docservice diff --git a/Dockerfile.balancer b/Dockerfile.balancer index bd642a6..6977ea1 100644 --- a/Dockerfile.balancer +++ b/Dockerfile.balancer @@ -9,6 +9,7 @@ RUN apt-get update -y && \ apt-get install python3.10 vim -y && \ apt-get install python3-pip -y && \ luarocks install lua-cjson && \ + luarocks install lua-resty-redis-connector && \ python3 -m pip install --upgrade pip && \ pip install redis requests kubernetes && \ rm -rf /var/lib/apt/lists/* && \ diff --git a/Dockerfile.noplugins b/Dockerfile.noplugins index e4939c7..f1fa4ec 100644 --- a/Dockerfile.noplugins +++ b/Dockerfile.noplugins @@ -10,19 +10,17 @@ ENV COMPANY_NAME=$COMPANY_NAME \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver -RUN yum install sudo -y && \ +RUN yum install sudo python3-pip -y && \ yum install shadow-utils -y && \ amazon-linux-extras install epel -y && \ yum install procps-ng tar wget -y && \ + pip3 install redis && \ wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_$(uname -m) && \ chmod +x /usr/local/bin/dumb-init && \ groupadd --system --gid 101 ds && \ useradd --system -g ds --no-create-home --shell /sbin/nologin --uid 101 ds && \ rm -f /var/log/*log -FROM python:2.7 AS redis-lib -RUN pip install redis==3.5.3 - FROM ds-base AS ds-service ARG TARGETARCH ARG DS_VERSION_HASH @@ -161,12 +159,6 @@ COPY --chown=ds:ds --from=ds-service \ COPY --from=ds-service \ /var/www/$COMPANY_NAME/documentserver/document-templates/new \ /var/www/$COMPANY_NAME/documentserver/document-templates/new -COPY --from=redis-lib \ - /usr/local/lib/python2.7/site-packages/redis \ - /usr/lib/python2.7/site-packages/redis -COPY --from=redis-lib \ - /usr/local/lib/python2.7/site-packages/redis-3.5.3.dist-info \ - /usr/lib/python2.7/site-packages/redis-3.5.3.dist-info COPY docker-entrypoint.sh /usr/local/bin/ RUN mkdir -p /var/www/$COMPANY_NAME/documentserver/sdkjs-plugins USER ds