From fac91eeee70ac5573e8e73b51d35abcc1dcd6b65 Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Wed, 8 Jan 2025 13:39:04 +0200 Subject: [PATCH] Add Dockerfile for comps-base image Signed-off-by: Eero Tamminen --- Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..b1db30c720 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +# Copyright (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Base image for GenAIComps based OPEA Python applications +# Build: docker build -t opea/comps-base -f Dockerfile . + +ARG IMAGE_NAME=python +ARG IMAGE_TAG=3.11-slim + +FROM ${IMAGE_NAME}:${IMAGE_TAG} AS base + +ENV HOME=/home/user + +RUN useradd -m -s /bin/bash user && \ + mkdir -p $HOME && \ + chown -R user $HOME + +# get security updates +RUN apt-get update && apt-get upgrade -y && \ + apt-get clean autoclean && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR $HOME + +COPY *.toml *.py *.txt *.md LICENSE ./ + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r requirements.txt + +COPY comps/ comps/ + +ENV PYTHONPATH=$PYTHONPATH:$HOME + +USER user + +ENTRYPOINT ["sh", "-c", "set && ls -la"]