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.
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.