From 28247f47e67f78a36843799602c5ad8368902a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schr=C3=B6der?= Date: Sat, 19 May 2018 20:51:14 +0200 Subject: [PATCH 1/2] Improve usage of docker build cache --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88e41a5..d7263d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM ubuntu:18.04 -ADD . /httpbin - RUN apt update -y RUN apt install python3-pip -y + +ADD . /httpbin + RUN pip3 install --no-cache-dir gunicorn /httpbin EXPOSE 80 From d449969d1b475087d705c596d7e811ab74260bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schr=C3=B6der?= Date: Sat, 19 May 2018 20:59:06 +0200 Subject: [PATCH 2/2] Reduce the number of docker layers --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7263d3..681bcd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ FROM ubuntu:18.04 -RUN apt update -y -RUN apt install python3-pip -y +RUN apt update -y && apt install python3-pip -y + +EXPOSE 80 ADD . /httpbin RUN pip3 install --no-cache-dir gunicorn /httpbin -EXPOSE 80 - CMD ["gunicorn", "-b", "0.0.0.0:80", "httpbin:app", "-k", "gevent"]