- '.:/usr/src/app' (under base) will mount your project dir . into the container(s) path /usr/src/app. This way both your host machine and container(s) see the same files and any changes will persist on your host machine after container has terminated. Additionally there’s a separate volume for Maven cache, which you want to share between your containers (otherwise maven downloads dependencies each time you execute lein commands). Volume(s) defined at the bottom will ‘survive’ until they’re explicitly deleted.
docker-compose run lein <args>executes any lein tasks. Example:docker-compose run lein cleandocker-compose up figwheelfires up figwheel which will be accessible from host on port 3449. (ctrl-c will quit). You need to useupinstead ofrunbecause run doesn’t allocate port mappings and therefore you’d never be able to access index.html from your host machines browser.docker-compose run shellstarts a bash session in container, for exploring and fun.docker-compose downremoves all containers.docker-compose down -vshuts down all containers and removes mvn_cache volume.