From 3abc9237ccabec8d34181e9a8fb8679308bdad6e Mon Sep 17 00:00:00 2001 From: Frank Wittig Date: Fri, 19 Jan 2018 03:06:04 +0100 Subject: [PATCH] Base image on Alpine to optimize image size Size is reduced to ~55MiB from ~680MiB before --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b5b985..9527085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ -from python:2.7-onbuild +FROM alpine:3.7 -expose 54321 +RUN apk add --no-cache python2 py2-pip -entrypoint ["python", "relay.py"] +COPY . /relay/ +RUN pip install -r /relay/requirements.txt + +WORKDIR /relay + +EXPOSE 54321 +ENTRYPOINT ["python", "relay.py"]