The Shared Directory

What the shared directory is for: a local-only mount every project gets, used for shared tool caches and for passing files between project containers.

Every Waddle project mounts the same directory, ~/.waddle/shared on the host, into every one of its services at /etc/waddle/shared. It exists as a deliberate crack in the wall between projects: a single place every container on your machine can read from and write to, regardless of which project it belongs to.

What it’s for

Two things, mainly:

  • Shared tool caches. Most projects lean on package managers and CLI tools to install their dependencies, and that means downloading the same packages over and over across every project on your machine. Pointing their caches at the shared directory means the second, third, and fifteenth projects all reuse what the first one already fetched, so repeat installs of website platforms are dramatically faster. The caches live under /etc/waddle/shared/cache: Composer’s in cache/composer, npm’s in cache/npm and WP-CLI’s in cache/wp-cli.
  • Moving files between projects. Since every project’s containers can see the same directory, it doubles as a drop box: drop a file in from one project’s container and it’s immediately readable from another’s, without copying through the host or setting up anything extra.

Local only

The shared directory only exists in local development. The mount is defined once, in docker-compose.override.yml, the file that holds everything specific to running on a developer’s own machine (see Docker Compose Files for how that file relates to the others).