February 2019
Intermediate to advanced
240 pages
5h 25m
English
Before we leave our docker-compose.yml, let’s make a small addition.
We’ve already seen how to mount a local directory inside a container with docker run by using the -v option—we did this in Generating a New Rails App Without Ruby Installed, so that the Rails project files generated inside the container would be available on our local machine.
A mounted local volume represents some filesystem that’s shared between your local machine and the container. Files in the mounted volume are synced both ways between your local filesystem and the container. Because of this, a local volume mount can allow us to develop locally and have the Rails server running in the container automatically pick up the file changes without restarting—just ...