From 5a6e59e06b5cb6795a60564c30cd8e0228afa65e Mon Sep 17 00:00:00 2001 From: Johan Steenhoven Date: Thu, 6 Jun 2019 13:33:13 +0200 Subject: [PATCH 1/3] Use alpine based python image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5a43a04..da81511 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-slim +FROM python:3.7-alpine WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt From b376ffa02dc387c4309248c56bd50a106b81901d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 4 Feb 2020 11:43:07 +0100 Subject: [PATCH 2/3] fixed missing gcc package --- Dockerfile | 14 ++++++++------ sidecar/helpers.py | 0 sidecar/resources.py | 0 sidecar/sidecar.py | 0 4 files changed, 8 insertions(+), 6 deletions(-) mode change 100644 => 100755 sidecar/helpers.py mode change 100644 => 100755 sidecar/resources.py mode change 100644 => 100755 sidecar/sidecar.py diff --git a/Dockerfile b/Dockerfile index afc35bb..6ad0e23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ -FROM python:3.7-alpine - -#create app directory +FROM python:3.7-alpine AS builder +ENV PYTHONUNBUFFERED=1 WORKDIR /app + COPY requirements.txt . -RUN pip install -r requirements.txt -COPY sidecar/* ./ -ENV PYTHONUNBUFFERED=1 +RUN apk add --no-cache gcc && \ + pip install -r requirements.txt && \ + apk del gcc + +COPY sidecar/* ./ #run as non-privileged user USER nobody diff --git a/sidecar/helpers.py b/sidecar/helpers.py old mode 100644 new mode 100755 diff --git a/sidecar/resources.py b/sidecar/resources.py old mode 100644 new mode 100755 diff --git a/sidecar/sidecar.py b/sidecar/sidecar.py old mode 100644 new mode 100755 From a0c696e999522317434a870fa9bb085baeeb164d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 4 Feb 2020 11:44:57 +0100 Subject: [PATCH 3/3] removed builder --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ad0e23..1493436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-alpine AS builder +FROM python:3.7-alpine ENV PYTHONUNBUFFERED=1 WORKDIR /app