From 580565da779559be82037b8f0afb609a2ddaa288 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 11 Dec 2021 18:28:35 +0100 Subject: [PATCH] Dockerfile: reduce # of steps & image size --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fee6345..ba6012d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ FROM alpine:latest -RUN apk add --no-cache python3 py3-pip py3-wheel py3-lxml - ADD . /app -RUN pip3 install --no-cache-dir /app[full] + +RUN set -ex; \ + apk add --no-cache --virtual .run-deps python3 py3-lxml; \ + apk add --no-cache --virtual .build-deps py3-pip py3-wheel; \ + pip3 install --no-cache-dir /app[full]; \ + apk del .build-deps; \ + rm -r /app USER 1000:1000