From eb89a86af469ce3d51bd53cb440f6980fd704fac 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 & reduce image sizes Signed-off-by: Eero Tamminen --- AudioQnA/Dockerfile | 28 +++----------------- AudioQnA/Dockerfile.multilang | 29 +++------------------ AvatarChatbot/Dockerfile | 30 +++------------------ ChatQnA/Dockerfile | 32 +++-------------------- ChatQnA/Dockerfile.guardrails | 32 +++-------------------- ChatQnA/Dockerfile.without_rerank | 32 +++-------------------- ChatQnA/Dockerfile.wrapper | 29 +++------------------ CodeGen/Dockerfile | 31 +++------------------- CodeTrans/Dockerfile | 29 +++------------------ DocIndexRetriever/Dockerfile | 27 +++---------------- DocSum/Dockerfile | 29 +++------------------ EdgeCraftRAG/Dockerfile | 31 +++------------------- FaqGen/Dockerfile | 30 +++------------------ GraphRAG/Dockerfile | 30 +++------------------ MultimodalQnA/Dockerfile | 28 +++----------------- SearchQnA/Dockerfile | 29 +++------------------ Translation/Dockerfile | 43 ++++--------------------------- VideoQnA/Dockerfile | 30 +++------------------ VisualQnA/Dockerfile | 29 +++------------------ 19 files changed, 59 insertions(+), 519 deletions(-) diff --git a/AudioQnA/Dockerfile b/AudioQnA/Dockerfile index 5797aee9f4..1294c218ca 100644 --- a/AudioQnA/Dockerfile +++ b/AudioQnA/Dockerfile @@ -1,31 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./audioqna.py /home/user/audioqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./audioqna.py $HOME/audioqna.py ENTRYPOINT ["python", "audioqna.py"] diff --git a/AudioQnA/Dockerfile.multilang b/AudioQnA/Dockerfile.multilang index ef7c926975..997e4bed37 100644 --- a/AudioQnA/Dockerfile.multilang +++ b/AudioQnA/Dockerfile.multilang @@ -1,32 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./audioqna_multilang.py /home/user/audioqna_multilang.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./audioqna_multilang.py $HOME/audioqna_multilang.py ENTRYPOINT ["python", "audioqna_multilang.py"] diff --git a/AvatarChatbot/Dockerfile b/AvatarChatbot/Dockerfile index b845296f70..86e5a9bc6c 100644 --- a/AvatarChatbot/Dockerfile +++ b/AvatarChatbot/Dockerfile @@ -1,33 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - vim \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git -WORKDIR /home/user/GenAIComps - -RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./avatarchatbot.py /home/user/avatarchatbot.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./avatarchatbot.py $HOME/avatarchatbot.py ENTRYPOINT ["python", "avatarchatbot.py"] diff --git a/ChatQnA/Dockerfile b/ChatQnA/Dockerfile index 4e431ac773..fffb8d8970 100644 --- a/ChatQnA/Dockerfile +++ b/ChatQnA/Dockerfile @@ -1,35 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \ - pip install --no-cache-dir langchain_core - -COPY ./chatqna.py /home/user/chatqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./chatqna.py $HOME/chatqna.py ENTRYPOINT ["python", "chatqna.py"] diff --git a/ChatQnA/Dockerfile.guardrails b/ChatQnA/Dockerfile.guardrails index ed811148c0..07a358d922 100644 --- a/ChatQnA/Dockerfile.guardrails +++ b/ChatQnA/Dockerfile.guardrails @@ -1,35 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \ - pip install --no-cache-dir langchain_core - -COPY ./chatqna.py /home/user/chatqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./chatqna.py $HOME/chatqna.py ENTRYPOINT ["python", "chatqna.py", "--with-guardrails"] diff --git a/ChatQnA/Dockerfile.without_rerank b/ChatQnA/Dockerfile.without_rerank index 7d3a94c5de..ad1611110a 100644 --- a/ChatQnA/Dockerfile.without_rerank +++ b/ChatQnA/Dockerfile.without_rerank @@ -1,35 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - git \ - libgl1-mesa-glx \ - libjemalloc-dev - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \ - pip install --no-cache-dir langchain_core - -COPY ./chatqna.py /home/user/chatqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./chatqna.py $HOME/chatqna.py ENTRYPOINT ["python", "chatqna.py", "--without-rerank"] diff --git a/ChatQnA/Dockerfile.wrapper b/ChatQnA/Dockerfile.wrapper index a9e4fb5444..73605cacbb 100644 --- a/ChatQnA/Dockerfile.wrapper +++ b/ChatQnA/Dockerfile.wrapper @@ -1,32 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./chatqna_wrapper.py /home/user/chatqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user - -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./chatqna_wrapper.py $HOME/chatqna.py ENTRYPOINT ["python", "chatqna.py"] diff --git a/CodeGen/Dockerfile b/CodeGen/Dockerfile index e0aa7d13f0..5305a9d89f 100644 --- a/CodeGen/Dockerfile +++ b/CodeGen/Dockerfile @@ -1,34 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -ENV LANG=C.UTF-8 - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./codegen.py /home/user/codegen.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./codegen.py $HOME/codegen.py ENTRYPOINT ["python", "codegen.py"] diff --git a/CodeTrans/Dockerfile b/CodeTrans/Dockerfile index 918d936c96..786cbcd243 100644 --- a/CodeTrans/Dockerfile +++ b/CodeTrans/Dockerfile @@ -1,32 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./code_translation.py /home/user/code_translation.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./code_translation.py $HOME/code_translation.py ENTRYPOINT ["python", "code_translation.py"] diff --git a/DocIndexRetriever/Dockerfile b/DocIndexRetriever/Dockerfile index c8794f3efc..06fb1dc016 100644 --- a/DocIndexRetriever/Dockerfile +++ b/DocIndexRetriever/Dockerfile @@ -1,30 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./retrieval_tool.py /home/user/retrieval_tool.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +COPY ./retrieval_tool.py $HOME/retrieval_tool.py ENTRYPOINT ["python", "retrieval_tool.py"] diff --git a/DocSum/Dockerfile b/DocSum/Dockerfile index 27e08ee7a3..51986d4e38 100644 --- a/DocSum/Dockerfile +++ b/DocSum/Dockerfile @@ -1,32 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git \ - ffmpeg - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./docsum.py /home/user/docsum.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +COPY ./docsum.py $HOME/docsum.py ENTRYPOINT ["python", "docsum.py"] - diff --git a/EdgeCraftRAG/Dockerfile b/EdgeCraftRAG/Dockerfile index b2a9984a8e..fffb8d8970 100644 --- a/EdgeCraftRAG/Dockerfile +++ b/EdgeCraftRAG/Dockerfile @@ -1,34 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -COPY ./chatqna.py /home/user/chatqna.py - -WORKDIR /home/user -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user - -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./chatqna.py $HOME/chatqna.py ENTRYPOINT ["python", "chatqna.py"] diff --git a/FaqGen/Dockerfile b/FaqGen/Dockerfile index 4018b44d1f..d315bbb61b 100644 --- a/FaqGen/Dockerfile +++ b/FaqGen/Dockerfile @@ -1,33 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./faqgen.py /home/user/faqgen.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./faqgen.py $HOME/faqgen.py ENTRYPOINT ["python", "faqgen.py"] diff --git a/GraphRAG/Dockerfile b/GraphRAG/Dockerfile index bf01c01b2e..0c2c91d85f 100644 --- a/GraphRAG/Dockerfile +++ b/GraphRAG/Dockerfile @@ -1,33 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - git \ - libgl1-mesa-glx \ - libjemalloc-dev - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \ - pip install --no-cache-dir langchain_core - -COPY ./graphrag.py /home/user/graphrag.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user - -RUN echo 'ulimit -S -n 999999' >> ~/.bashrc +COPY ./graphrag.py $HOME/graphrag.py ENTRYPOINT ["python", "graphrag.py"] diff --git a/MultimodalQnA/Dockerfile b/MultimodalQnA/Dockerfile index 534203c96e..90ce8e3207 100644 --- a/MultimodalQnA/Dockerfile +++ b/MultimodalQnA/Dockerfile @@ -1,31 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./multimodalqna.py /home/user/multimodalqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +COPY ./multimodalqna.py $HOME/multimodalqna.py ENTRYPOINT ["python", "multimodalqna.py"] -# ENTRYPOINT ["/usr/bin/sleep", "infinity"] diff --git a/SearchQnA/Dockerfile b/SearchQnA/Dockerfile index 2d8e59f6b5..a93afd6093 100644 --- a/SearchQnA/Dockerfile +++ b/SearchQnA/Dockerfile @@ -1,32 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./searchqna.py /home/user/searchqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./searchqna.py $HOME/searchqna.py ENTRYPOINT ["python", "searchqna.py"] diff --git a/Translation/Dockerfile b/Translation/Dockerfile index 33931689c1..853935af84 100644 --- a/Translation/Dockerfile +++ b/Translation/Dockerfile @@ -1,42 +1,9 @@ -# Copyright (c) 2024 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./translation.py /home/user/translation.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user - -WORKDIR /home/user +COPY ./translation.py $HOME/translation.py ENTRYPOINT ["python", "translation.py"] diff --git a/VideoQnA/Dockerfile b/VideoQnA/Dockerfile index bd1ff121f5..2aade6088f 100644 --- a/VideoQnA/Dockerfile +++ b/VideoQnA/Dockerfile @@ -1,33 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ - -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./videoqna.py /home/user/videoqna.py - -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./videoqna.py $HOME/videoqna.py ENTRYPOINT ["python", "videoqna.py"] diff --git a/VisualQnA/Dockerfile b/VisualQnA/Dockerfile index ef6a2e2536..95936d9c03 100644 --- a/VisualQnA/Dockerfile +++ b/VisualQnA/Dockerfile @@ -1,32 +1,9 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM python:3.11-slim - -RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ - libgl1-mesa-glx \ - libjemalloc-dev \ - git - -RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user/ - -WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git - -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt - -COPY ./visualqna.py /home/user/visualqna.py - -ENV PYTHONPATH=/home/user/GenAIComps - -USER user +ARG BASE_TAG=latest +FROM opea/comps-base:$BASE_TAG -WORKDIR /home/user +COPY ./visualqna.py $HOME/visualqna.py ENTRYPOINT ["python", "visualqna.py"]