This question seems to have a simple answer on the surface "volumes" although I believe it may be more complex then that.
We have three services, each of these services can have many containers running across the single or multiple hosts.
Container A is our API container
Container B is our queue container
Container C is our task-schedule (cron) container
All these containers are running off the same git-repo / source code (PHP). The only difference is the process that is running within containers:
Container A is running php-fpm
Container B is running a queue monitoring daemon (artisan queue)
Container C is running crontab that executes any cron tasks
At present in the dockerfile for each "service" we download the git repo and boot up the relevant process. Although it would be better to have a "data" container that somehow serves the code to all the above mentionsed containers.
How can we create a container that acts as a "code repository" for other containers? Mounting the source files from its file system into the file systems of other "service" containers?