Install requirements in Dockerfile from requirements.txt

This commit is contained in:
Florian Schäfer 2017-12-07 13:45:18 +01:00
parent 2c7303a561
commit c256a1f7c5
2 changed files with 9 additions and 12 deletions

View File

@ -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"]

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
flask==0.12.2
requests==2.18.4