3

I'm having an issue with storing images to a dokku module that is running on digital ocean.

I'm using

  • meanjs 0.4.0
  • angular-file-upload (for the upload)
  • digital ocean droplet with Dokku 0.3.18 and ubuntu 14.04

What I did so far:

  1. Implemented and tested the code locally - works fine
  2. Deployed the code to digital ocean
  3. Added a persistent storage via:

    dokku docker-options:add vnmean run "-v /home/dokku/vnmean/share:/modules/pictures/client/img"
    dokku docker-options:add vnmean deploy "-v /home/dokku/vnmean/share:/modules/pictures/client/img"
    
  4. Rebuild the app "dokku ps:rebuild vnmean" and checked the container via

    docker inspect <containerId>
    

With the result (at the end):

"Volumes": {
    "/modules/pictures/client/img": "/home/dokku/vnmean/share"
},
"VolumesRW": {
    "/modules/pictures/client/img": true
}
  1. I also checked the two folders via:

    dokku run vnmean ls /modules/pictures/client/img
    

And via:

    ls /home/dokku/vnmean/share

I can change any of the folders via host-shell and the other one gets updated.

Issue:

Whenever I upload a picture via web-fileupload none of the folders is updated. I would expect that the /home/dokku/vnmean/share folder would now hold the uploaded data, but unfortunately it's unchanged.

I know that the picture upload worked as it is displayed afterwards but as soon as I do a restart or redeploy, the pictures are gone.

I'm not sure if I got something wrong with the persistent storage or if I missed a step.

Could you have a look and let me know what's the issue or what can be done to get a folder that stores the uploads without getting overwritten during restart or deploy and that can be accessed from the host-shell?

Brian
  • 14,610
  • 7
  • 35
  • 43
Prince V
  • 81
  • 8

2 Answers2

0

I think you have to set the owner of the folder

chown dokku:dokku /home/dokku/vnmean/share
Plasticut
  • 67
  • 1
  • 1
  • The [docker-options portion](http://dokku.viewdocs.io/dokku/docker-options/) in dokku docs seems relevant. Key aspects are: dokku version, the two options commands and shared folder ownership. – Epigene Dec 16 '15 at 10:18
0

Dokku has a volume (Storage) -plugin since a while that abstracts some of the lifting.

http://dokku.viewdocs.io/dokku/advanced-usage/persistent-storage/

Felix
  • 4,510
  • 2
  • 31
  • 46