From 55747cfea894a5081717ef6f6df9a991ac9c109e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 3 Jul 2016 15:07:56 -0400 Subject: [PATCH] Clean up documentation surrounding persistent storage Closes #2284 [ci skip] --- docs/dokku-storage.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/dokku-storage.md b/docs/dokku-storage.md index 52c8dea75..a2cfd61d5 100644 --- a/docs/dokku-storage.md +++ b/docs/dokku-storage.md @@ -18,11 +18,28 @@ The storage plugin requires explicit paths on the host side. This is intentional ## Usage This example demonstrates how to mount the recommended directory to `/storage` inside the container: + ``` $ dokku storage:mount app-name /var/lib/dokku/data/storage:/storage ``` + Dokku will then mount the shared contents of`/var/lib/dokku/data/storage` to `/storage` inside the container. +A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root of the container. + +```shell +# creating storage for the app 'ruby-rails-sample' +mkdir -p /var/lib/dokku/data/storage/ruby-rails-sample + +# ensure the dokku user has access to this directory +chown -R dokku:dokku /var/lib/dokku/data/storage/ruby-rails-sample + +# mount the directory into your container's /app/storage directory, relative to root +dokku storage:mount app-name /var/lib/dokku/data/storage/app-name:/app/storage +``` + +You can mount one or more directories as desired by following the above pattern. + ## Use Cases ### Persistent storage