From 20ee4de8d387901bce4f35c43b6dadc24ef143f6 Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Mon, 16 Oct 2017 14:24:04 +0200 Subject: [PATCH] Uses ONBUILD in Dockerfile to install deps while building Copies `Pipfile` and `Pipefile.lock`, installs deps on building a docker image using the official pipenv image. --- Dockerfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7ea90e59..c2a74c37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ -FROM python:3.6.2 +FROM python:3.6.3 # -- Install Pipenv: -RUN pip install pipenv --upgrade +RUN set -ex && pip install pipenv --upgrade # -- Install Application into container: -RUN mkdir /app +RUN set -ex && mkdir /app + WORKDIR /app +# -- Adding Pipfiles +ONBUILD COPY Pipfile Pipfile +ONBUILD COPY Pipfile.lock Pipfile.lock + +# -- Install dependencies: +ONBUILD RUN set -ex && pipenv install --deploy --system + # -------------------- # - Using This File: - # -------------------- # FROM kennethreitz/pipenv -# COPY Pipfile Pipfile -# COPY Pipfile.lock Pipfile.lock # COPY . /app - -# -- Install dependencies: -# RUN pipenv install --deploy --system - -ENTRYPOINT [] -CMD [ "/bin/bash" ] \ No newline at end of file