diff --git a/AudioQnA/Dockerfile b/AudioQnA/Dockerfile index 07245de371..1294c218ca 100644 --- a/AudioQnA/Dockerfile +++ b/AudioQnA/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 ./audioqna.py $HOME/audioqna.py diff --git a/AudioQnA/Dockerfile.multilang b/AudioQnA/Dockerfile.multilang index 1d0573d217..997e4bed37 100644 --- a/AudioQnA/Dockerfile.multilang +++ b/AudioQnA/Dockerfile.multilang @@ -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 ./audioqna_multilang.py $HOME/audioqna_multilang.py diff --git a/DocIndexRetriever/Dockerfile b/DocIndexRetriever/Dockerfile index dcfd665f74..06fb1dc016 100644 --- a/DocIndexRetriever/Dockerfile +++ b/DocIndexRetriever/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 ./retrieval_tool.py $HOME/retrieval_tool.py diff --git a/EdgeCraftRAG/Dockerfile b/EdgeCraftRAG/Dockerfile index fb7f5e14ec..fffb8d8970 100644 --- a/EdgeCraftRAG/Dockerfile +++ b/EdgeCraftRAG/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 ./chatqna.py $HOME/chatqna.py diff --git a/FaqGen/Dockerfile b/FaqGen/Dockerfile index 2d1afd002a..d315bbb61b 100644 --- a/FaqGen/Dockerfile +++ b/FaqGen/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 ./faqgen.py $HOME/faqgen.py diff --git a/VideoQnA/Dockerfile b/VideoQnA/Dockerfile index 0504a71881..2aade6088f 100644 --- a/VideoQnA/Dockerfile +++ b/VideoQnA/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 ./videoqna.py $HOME/videoqna.py