From 4aca09c143a53b6f713f51ead15d6a5a07d0b79c Mon Sep 17 00:00:00 2001 From: K8sCat Date: Tue, 6 Apr 2021 11:50:37 +0800 Subject: [PATCH 1/2] :zap: optimize: use python:3.6-alpine --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 280f8b07..b83345d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ -FROM python:3.6 +FROM python:3.6-alpine WORKDIR /app COPY . . # RUN pip install -r requirements.txt -i https://pypi.douban.com/simple -RUN pip install -r requirements.txt +RUN apk add --no-cache libxml2-dev \ +libxslt-dev \ +gcc \ +musl-dev && \ +pip install -r requirements.txt VOLUME ["/app/proxypool/crawlers/private"] CMD ["supervisord", "-c", "supervisord.conf"] From 0239d5ffabc8c50ca938cf665f5436d6ef44d473 Mon Sep 17 00:00:00 2001 From: K8sCat Date: Mon, 12 Apr 2021 12:36:00 +0800 Subject: [PATCH 2/2] :rocket: update: del build pkgs --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b83345d6..c38bf89b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,8 @@ FROM python:3.6-alpine WORKDIR /app COPY . . # RUN pip install -r requirements.txt -i https://pypi.douban.com/simple -RUN apk add --no-cache libxml2-dev \ -libxslt-dev \ -gcc \ -musl-dev && \ -pip install -r requirements.txt +RUN apk add --no-cache libxml2-dev libxslt-dev gcc musl-dev && \ +pip install -r requirements.txt && \ +apk del gcc musl-dev libxml2-dev VOLUME ["/app/proxypool/crawlers/private"] CMD ["supervisord", "-c", "supervisord.conf"]