From 9500ec1da92c7a07dbafa49cf3d5f7a2826e21ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:20:19 +0000 Subject: [PATCH] optimize Dockerfile --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40d7e0d..483a8e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,18 +3,22 @@ FROM python:3.11-alpine ENV \ PYTHONUNBUFFERED=1 +# copy app source COPY . /usr/src/app RUN set -ex; \ - # buildtime deps + # install buildtime deps apk add --no-cache \ --virtual .build-deps \ build-base \ gcc \ linux-headers \ + ; \ + # install app + pip3 --no-cache-dir install /usr/src/app; \ + # remove buildtime deps + apk del --no-cache \ + .build-deps \ ; -RUN set -ex; \ - pip3 --no-cache-dir install /usr/src/app - ENTRYPOINT ["kiwi-simple-metrics"] \ No newline at end of file