Skip to content

Commit 8b7cb35

Browse files
eero-tchensuyue
andauthored
Use GenAIComp base image to simplify Dockerfiles & reduce image sizes (#1369)
Signed-off-by: Eero Tamminen <[email protected]> Co-authored-by: chen, suyue <[email protected]>
1 parent 5f4b3a6 commit 8b7cb35

File tree

1 file changed

+2
-42
lines changed

1 file changed

+2
-42
lines changed

AvatarChatbot/Dockerfile

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,8 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Stage 1: base setup used by other stages
5-
FROM python:3.11-slim AS base
6-
7-
# get security updates
8-
RUN apt-get update && apt-get upgrade -y && \
9-
apt-get clean && rm -rf /var/lib/apt/lists/*
10-
11-
ENV HOME=/home/user
12-
13-
RUN useradd -m -s /bin/bash user && \
14-
mkdir -p $HOME && \
15-
chown -R user $HOME
16-
17-
WORKDIR $HOME
18-
19-
20-
# Stage 2: latest GenAIComps sources
21-
FROM base AS git
22-
23-
RUN apt-get update && apt-get install -y --no-install-recommends git
24-
RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
25-
26-
27-
# Stage 3: common layer shared by services using GenAIComps
28-
FROM base AS comps-base
29-
30-
# copy just relevant parts
31-
COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
32-
COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
33-
34-
WORKDIR $HOME/GenAIComps
35-
RUN pip install --no-cache-dir --upgrade pip setuptools && \
36-
pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
37-
WORKDIR $HOME
38-
39-
ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
40-
41-
USER user
42-
43-
44-
# Stage 4: unique part
45-
FROM comps-base
4+
ARG BASE_TAG=latest
5+
FROM opea/comps-base:$BASE_TAG
466

477
COPY ./avatarchatbot.py $HOME/avatarchatbot.py
488

0 commit comments

Comments
 (0)