From d2afc7cee4a971b28bf47855e52900d9d80630ca Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 1 Mar 2020 14:08:16 +0200 Subject: [PATCH] Improve standalone dockerfile for caching --- maubot/standalone/Dockerfile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/maubot/standalone/Dockerfile b/maubot/standalone/Dockerfile index f24ee25..2475749 100644 --- a/maubot/standalone/Dockerfile +++ b/maubot/standalone/Dockerfile @@ -1,12 +1,6 @@ FROM docker.io/alpine:3.11 -COPY . /opt/maubot -RUN cd /opt/maubot \ - && apk add --no-cache --virtual .build-deps \ - python3-dev \ - libffi-dev \ - build-base \ - && apk add --no-cache \ +RUN apk add --no-cache \ py3-aiohttp \ py3-sqlalchemy \ py3-attrs \ @@ -18,6 +12,16 @@ RUN cd /opt/maubot \ py3-ruamel.yaml \ py3-jinja2 \ py3-packaging \ - py3-markdown \ - && pip3 install . \ + py3-markdown + +COPY requirements.txt /opt/maubot/requirements.txt +RUN cd /opt/maubot \ + && apk add --no-cache --virtual .build-deps \ + python3-dev \ + libffi-dev \ + build-base \ + && pip3 install -r requirements.txt \ && apk del .build-deps + +COPY . /opt/maubot +RUN cd /opt/maubot && pip3 install .