From 7c299786f0080ba6d7341f43722a080d05f2fc31 Mon Sep 17 00:00:00 2001 From: Homer S Date: Sun, 11 Jul 2021 16:23:13 +0200 Subject: [PATCH] Reduced image size furtherly. Now 329MB and based on python:alpine. --- docker/Dockerfile | 16 ++++++++++++---- docker/docker-compose.yml | 2 +- requirements.txt | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1091952..c1956ba 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM alpine:latest +FROM python:alpine ENV TZ=Europe/Berlin ENV UNBUFFERED=1 @@ -11,9 +11,17 @@ VOLUME /app COPY . . RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone; \ - /bin/sh -c 'apk update && apk add --no-cache gcc musl-dev python3-dev py3-pip libffi-dev openssl-dev cargo zlib-dev jpeg-dev speex ffmpeg htop; \ - pip install update pip && pip install -r requirements.txt ; \ - apk del zlib-dev jpeg-dev gcc musl-dev python3-dev libffi-dev openssl-dev cargo;' + apk --no-cache update && apk add --no-cache --virtual .build-deps \ + gcc \ + cargo \ + libffi-dev \ + openssl-dev \ + zlib-dev \ + jpeg-dev ; \ + apk add --no-cache ffmpeg speex; \ + pip install --no-cache-dir upgrade pip; \ + pip install --no-cache-dir -r requirements.txt ; \ + apk del --no-cache .build-deps; diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 49e9071..74ed631 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: context: ../. dockerfile: ./docker/Dockerfile working_dir: /app - entrypoint: /bin/sh -c "export UNBUFFERED=1 && python3 -u ./fritzab2matrix.py" +# entrypoint: /bin/sh -c "export UNBUFFERED=1 && python3 -u ./fritzab2matrix.py" volumes: - ../.:/app diff --git a/requirements.txt b/requirements.txt index 8cdb0c7..63f532e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +requests fritzconnection python-dotenv xmltodict