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

Optimize Dockerfile #82

Merged
merged 3 commits into from
Aug 27, 2020
Merged

Optimize Dockerfile #82

merged 3 commits into from
Aug 27, 2020

Conversation

harlev
Copy link
Contributor

@harlev harlev commented Aug 25, 2020

Copying the whole project content with COPY . /app before installing the requirements, causes every change in any file to cause reinstallation of all requirements on the next Docker build.

After the change, only the requirements files are copied first with COPY *requirements* /app/
Then the requirements are installed, and this layer of the image could be cached for later builds, even if the application changes.

It is easy to test and see that after an initial build, changing anything in the application, will not reinstall all the dependencies on the next Docker build, resulting in a much faster build

@bryanyang0528
Copy link
Owner

@harlev Thanks for updating.

@bryanyang0528 bryanyang0528 merged commit e74b650 into bryanyang0528:master Aug 27, 2020
@bryanyang0528 bryanyang0528 added this to the 0.10.2 milestone Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants