Skip to content

Commit

Permalink
Copy and install requirements before copying code
Browse files Browse the repository at this point in the history
This removes the need to reinstall all python packages
everytime a new build occurs
  • Loading branch information
paramsingh committed Feb 22, 2018
1 parent c4340f3 commit c2857b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/Dockerfile.py2
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
git
COPY . /code/

COPY requirements.txt /code/requirements.txt
COPY requirements_dev.txt /code/requirements_dev.txt
RUN pip install -r requirements.txt
RUN pip install -r requirements_dev.txt

COPY . /code/

ENV REDIS_HOST "redis"

CMD dockerize -wait tcp://redis:6379 -timeout 10s \
Expand Down
6 changes: 5 additions & 1 deletion test/Dockerfile.py3
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
git
COPY . /code/

COPY requirements.txt /code/requirements.txt
COPY requirements_dev.txt /code/requirements_dev.txt
RUN pip install -r requirements.txt
RUN pip install -r requirements_dev.txt

COPY . /code/

ENV REDIS_HOST "redis"

CMD dockerize -wait tcp://redis:6379 -timeout 10s \
Expand Down

0 comments on commit c2857b7

Please sign in to comment.