Mounting volumes is essentially required but can cause insane performance issues. Therefore it is very important to configure them correctly to prevent bottlenecks. This issue affects mainly Docker for Mac and Docker for Windows as Linux hosts can mount paths “more natively” into the container.
With the following flags, docker can manage the sync interval between the filesystem, to increase the perfomance.
Now let’s check if the volume mounts were all configured correctly:
The containers view is the truth. There can be a delay until changes are available to the host.
Useful for example the database
The host view is the truth. There can be a delay until changes are available to the container.
Useful for example the codebase
Keep perfect sync