From fccdb28084d8fdee5264cb74d5938fd64c119e4c Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Fri, 25 Oct 2024 18:54:52 +0300 Subject: [PATCH] Use GenAIComp base image to simplify Dockerfiles - part 4/4 Update the last remaining application (megaservice) image of the 15 apps that use GenAIComps repo code as base. Signed-off-by: Eero Tamminen --- AvatarChatbot/Dockerfile | 44 ++-------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/AvatarChatbot/Dockerfile b/AvatarChatbot/Dockerfile index f0fa5744e7..86e5a9bc6c 100644 --- a/AvatarChatbot/Dockerfile +++ b/AvatarChatbot/Dockerfile @@ -1,48 +1,8 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# Stage 1: base setup used by other stages -FROM python:3.11-slim AS base - -# get security updates -RUN apt-get update && apt-get upgrade -y && \ - apt-get clean && rm -rf /var/lib/apt/lists/* - -ENV HOME=/home/user - -RUN useradd -m -s /bin/bash user && \ - mkdir -p $HOME && \ - chown -R user $HOME - -WORKDIR $HOME - - -# Stage 2: latest GenAIComps sources -FROM base AS git - -RUN apt-get update && apt-get install -y --no-install-recommends git -RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git - - -# Stage 3: common layer shared by services using GenAIComps -FROM base AS comps-base - -# copy just relevant parts -COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps -COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/ - -WORKDIR $HOME/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt -WORKDIR $HOME - -ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps - -USER user - - -# Stage 4: unique part -FROM comps-base +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG COPY ./avatarchatbot.py $HOME/avatarchatbot.py