In the previous chapter, we talked about and used a **named volume** to persist the data in our database.
Named volumes are great if we simply want to store data, as we don't have to worry about _where_ the data
is stored.
With **bind mounts**, we control the exact mountpoint on the host. We can use this to persist data, but is often
used to provide additional data into containers. When working on an application, we can use a bind mount to
mount our source code into the container to let it see code changes, respond, and let us see the changes right
away.
For Node-based applications, [nodemon](https://npmjs.com/package/nodemon) is a great tool to watch for file
changes and then restart the application. There are equivalent tools in most other languages and frameworks.
## Quick Volume Type Comparisons
Bind mounts and named volumes are the two main types of volumes that come with the Docker engine. However, additional
volume drivers are available to support other uses cases ([SFTP](https://github.com/vieux/docker-volume-sshfs), [Ceph](https://ceph.com/geen-categorie/getting-started-with-the-docker-rbd-volume-plugin/), [NetApp](https://netappdvp.readthedocs.io/en/stable/), [S3](https://github.com/elementar/docker-s3-volume), and more).
| | Named Volumes | Bind Mounts |
| - | ------------- | ----------- |
| Host Location | Docker chooses | You control |
| Mount Example (using `-v`) | my-volume:/usr/local/data | /path/to/data:/usr/local/data |
| Populates new volume with container contents | Yes | No |
| Supports Volume Drivers | Yes | No |
## Starting a Dev-Mode Container
To run our container to support a development workflow, we will do the following:
- Mount our source code into the container
- Install all dependencies, including the "dev" dependencies
- Start nodemon to watch for filesystem changes
So, let's do it!
1. Make sure you don't have any previous `getting-started` containers running.
### Optionals steps for "resource sharing" may be required
If the `docker run...` command above fails with an error message, stating `docker: Error response form daemon: status code not OK but 500:...`, it's likely caused by the fact, that resource sharing is disabled (e.g. default in "Docker Desktop for Windows").
To make it work, you need to add a path to the "Docker Desktop" configuration, to define it as a shared ressource between the host and docker containers.
1. Click the "gear" symbol inside the docker dashboard, to open the "Settings" panel.
1. Click "Resources"
1. Click "FILE SHARING"
1. Click on blue "plus" symbol
1. Enter the path to the shared folder
1. Click on "Apply & Restart"
***Please note:** If the path name is automatically shortened, you need to make sure it's still valid. In most cases you'll need to manually reduce the path name to the directory on the higher level.*