Skip to content

Commit

Permalink
Get security updates & parametrize base image name
Browse files Browse the repository at this point in the history
And fix hadolint warning.

Signed-off-by: Eero Tamminen <[email protected]>
  • Loading branch information
eero-t committed Jan 8, 2025
1 parent cbbeaef commit 91ddd61
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@
# Base image for GenAIComps based OPEA Python applications
# Build: docker build -t opea/comps-base -f Dockerfile .

FROM python:3.11-slim
ARG IMAGE_NAME=python
ARG IMAGE_TAG=3.11-slim

RUN apt-get update
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 && rm -rf /var/lib/apt/lists/*

WORKDIR $HOME

COPY *.toml *.py *.txt *.md LICENSE .
COPY *.toml *.py *.txt *.md LICENSE ./

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r requirements.txt
Expand Down

0 comments on commit 91ddd61

Please sign in to comment.