diff --git a/ChatQnA/Dockerfile b/ChatQnA/Dockerfile index fb7f5e14ec..fffb8d8970 100644 --- a/ChatQnA/Dockerfile +++ b/ChatQnA/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/ChatQnA/Dockerfile.guardrails b/ChatQnA/Dockerfile.guardrails index 4fe5fd2087..07a358d922 100644 --- a/ChatQnA/Dockerfile.guardrails +++ b/ChatQnA/Dockerfile.guardrails @@ -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/ChatQnA/Dockerfile.without_rerank b/ChatQnA/Dockerfile.without_rerank index 9e6740e9b8..ad1611110a 100644 --- a/ChatQnA/Dockerfile.without_rerank +++ b/ChatQnA/Dockerfile.without_rerank @@ -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/DocSum/Dockerfile b/DocSum/Dockerfile index fd01f3bca0..2cc8c3d5a5 100644 --- a/DocSum/Dockerfile +++ b/DocSum/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 USER root # FFmpeg needed for media processing diff --git a/GraphRAG/Dockerfile b/GraphRAG/Dockerfile index 1e50649dd5..0c2c91d85f 100644 --- a/GraphRAG/Dockerfile +++ b/GraphRAG/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 ./graphrag.py $HOME/graphrag.py diff --git a/SearchQnA/Dockerfile b/SearchQnA/Dockerfile index df8d536b08..a93afd6093 100644 --- a/SearchQnA/Dockerfile +++ b/SearchQnA/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 ./searchqna.py $HOME/searchqna.py diff --git a/Translation/Dockerfile b/Translation/Dockerfile index 70266c9b87..853935af84 100644 --- a/Translation/Dockerfile +++ b/Translation/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 ./translation.py $HOME/translation.py diff --git a/VisualQnA/Dockerfile b/VisualQnA/Dockerfile index 257b39df89..95936d9c03 100644 --- a/VisualQnA/Dockerfile +++ b/VisualQnA/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 ./visualqna.py $HOME/visualqna.py