dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

How to attach a persistent volume? #55

Closed derekstavis closed 8 years ago

derekstavis commented 8 years ago

I'm trying to use dokku docker-options to add a persistent volume to mongodb container. Unfortunately, I found no way of doing it because docker-options expect and app name and theoretically this plugin doesn't expose an app.

What's the right way of accomplishing this task?

josegonzalez commented 8 years ago

A persistent volume? The mongodb container already persists it's data to disk, you don't need to do anything.

derekstavis commented 8 years ago

Ok. I gave a look at the source code, and at this line the persistent volume is mounted inside mongo's docker container. I'd like to have a way to specify my own path, instead of needing to use the default $SERVICE_ROOT/data directory.

josegonzalez commented 8 years ago

Sorry, that's not possible, and I don't see any benefits to being able to do this. Is there a reason you want this functionality?

derekstavis commented 8 years ago

Yes. In my scenario I have some external attached disks in my cloud instance, and the volumes are mounted in /mnt/db-dev and /mnt/db-prod, for example. I could mount inside dokku-mongo default location, but this doesn't look good to me.

josegonzalez commented 8 years ago

Try a symlink instead?

derekstavis commented 8 years ago

Thanks for the fast response. I have opted to mount the volume inside plugin's default directory.