From 572a70bbedfab1ae9ac3ae18fdec1b31dfedab2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Sat, 28 Oct 2017 13:27:49 +0200 Subject: [PATCH 1/3] Build Dockerfile using local code instead of pulling the GitHub repo --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6020e8f..a7c35ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,9 @@ WORKDIR /app ENV BUILD_LIST git +COPY blockchain.py Pipfile /app/ + RUN apk add --update $BUILD_LIST \ - && git clone https://github.com/dvf/blockchain.git /app \ && pip install pipenv \ && pipenv --python=python3.6 \ && pipenv install \ From 2c7303a5614435623dbbf14b72a935357950ab58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Tue, 14 Nov 2017 21:37:22 +0100 Subject: [PATCH 2/3] Build Dockerfile locally as discussed in #32 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a7c35ac..8f3df9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app ENV BUILD_LIST git -COPY blockchain.py Pipfile /app/ +COPY Pipfile /app RUN apk add --update $BUILD_LIST \ && pip install pipenv \ @@ -13,6 +13,8 @@ RUN apk add --update $BUILD_LIST \ && apk del $BUILD_LIST \ && rm -rf /var/cache/apk/* +COPY blockchain.py /app + EXPOSE 5000 ENTRYPOINT [ "pipenv", "run", "python", "/app/blockchain.py", "--port", "5000" ] From c256a1f7c591747c917566d439224b2a3c966775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Thu, 7 Dec 2017 13:45:18 +0100 Subject: [PATCH 3/3] Install requirements in Dockerfile from requirements.txt --- Dockerfile | 19 +++++++------------ requirements.txt | 2 ++ 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 8f3df9b..82de324 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,19 +2,14 @@ FROM python:3.6-alpine WORKDIR /app -ENV BUILD_LIST git +# Install dependencies. +ADD requirements.txt /app +RUN cd /app && \ + pip install -r requirements.txt -COPY Pipfile /app - -RUN apk add --update $BUILD_LIST \ - && pip install pipenv \ - && pipenv --python=python3.6 \ - && pipenv install \ - && apk del $BUILD_LIST \ - && rm -rf /var/cache/apk/* - -COPY blockchain.py /app +# Add actual source code. +ADD blockchain.py /app EXPOSE 5000 -ENTRYPOINT [ "pipenv", "run", "python", "/app/blockchain.py", "--port", "5000" ] +CMD ["python", "blockchain.py", "--port", "5000"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..990b2d8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +flask==0.12.2 +requests==2.18.4