Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder dockerfile to optimize build time. #30

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM python:3

WORKDIR /app
# Copy our current directory.
ADD . /app

# This will be shown on docker build
RUN python --version
# Copy only the requirements so we can have an image with full dependencies.
ADD requirements.txt /app
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# This means that you can access the cointainer's port 80, not that our actual
# Now we can copy the rest of the code.
ADD . /app

# This means that you can access the cointainer's port 5000, not that our actual
# machine will have the port 5000 accessible.
EXPOSE 5000

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ psycopg2-binary
scipy
numpy
gunicorn>=19.9.0
psycopg2>=2.7.5
psycopg2>=2.7.5