firstlookmedia / flock-server

🦉 Flock is a privacy-preserving fleet management system powered by osquery and the Elastic Stack
GNU General Public License v3.0
19 stars 1 forks source link

Don't rebuild pipenv for most code changes #32

Closed simonft closed 4 years ago

simonft commented 4 years ago

Previously the Dockerfile for flock would do a copy of the whole directory before it installed the pipenv. Since docker checks whether anything in a COPY has changed when deciding if it needs to rebuild later stages, a change to any file in flock would cause the app's whole pipenv to be recreated. This process takes some time. This commit changes the Dockerfile to first copy just the pipfile file and pipfile.lock, then install the dependencies, and then copy the rest of the flock files. This allows docker to cache the pipenv step in all cases except when the pipfile has been changed.