From c3a4de96d1d2bb7112d9112b1ea7ca3e9cf4c2d0 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 27 Oct 2023 10:12:42 +0000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14a6735..a2df980 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. ## creating building container -FROM python:3.10-slim AS builder +FROM python:3.10.9-slim-bullseye AS builder # update and install dependencies RUN apt update RUN apt upgrade -y @@ -26,14 +26,18 @@ WORKDIR /service RUN python -m build # creating running container -FROM python:3.10-slim +FROM python:3.10.9-slim-bullseye # update and install dependencies RUN apt update RUN apt upgrade -y -# copy and install wheel +# copy and install requirements and wheel WORKDIR /service +COPY --from=builder /service/requirements.txt /service +RUN pip install --no-deps -r requirements.txt +RUN rm requirements.txt COPY --from=builder /service/dist/ /service -RUN pip install *.whl +RUN pip install --no-deps *.whl +RUN rm *.whl # create new user and execute as that user RUN useradd --create-home appuser WORKDIR /home/appuser