From f837f2229bc4eedf87d7fd6f975026dcda086692 Mon Sep 17 00:00:00 2001 From: Oliver Marks Date: Sun, 26 Feb 2017 10:03:14 +0000 Subject: [PATCH] Add local pip cache to avoid repeating downloads --- .drone.yml | 2 +- compose/django/Dockerfile | 2 +- compose/django/Dockerfile-dev | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index abf0276..ec85323 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,7 +28,7 @@ pipeline: - cd /var/www/stage/maidstone-hackspace-website - git pull - docker-compose -fstage.yml build - - docker-compose -fstage.yml down + - docker-compose -fstage.yml down --remove-orphans - docker-compose -fstage.yml up -d publish-live: diff --git a/compose/django/Dockerfile b/compose/django/Dockerfile index 6d9fde2..2a02570 100644 --- a/compose/django/Dockerfile +++ b/compose/django/Dockerfile @@ -5,7 +5,7 @@ ENV PYTHONUNBUFFERED 1 # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements -RUN pip install -r /requirements/production.txt \ +RUN pip install --cache-dir ./cache/pip -r /requirements/production.txt \ && groupadd -r django \ && useradd -r -g django django diff --git a/compose/django/Dockerfile-dev b/compose/django/Dockerfile-dev index 77373f2..70b4eba 100644 --- a/compose/django/Dockerfile-dev +++ b/compose/django/Dockerfile-dev @@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED 1 # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements -RUN pip install -r /requirements/local.txt +RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt COPY ./compose/django/entrypoint.sh /entrypoint.sh RUN sed -i 's/\r//' /entrypoint.sh