By roadtodroid
I’m pretty new to digital ocean and developed a Go app. The app works by fetching images from sources on the web and store them in a local directory for further serving. The app is working fine in the localhost , but when deployed using dokku , nothing happens. The app cannot seem to find the images.
I searched and found to configure persistent-storage or volume-plugin. I’m confused with this and need help.
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, making persistent storage for images (maybe uploads from your users) on DO instance is pretty easy:
mkdir -p /opt/dokku/YOUR_APP_NAME/uploadsPROJECT_ROOT/uploadsdocker-options for you app
dokku docker-options:add YOUR_APP deploy,run "-v /opt/dokku/YOUR_APP_NAME/uploads:/app/uploads"That last command made Dokku expose PROJECT_ROOT/uploads folder to be linked to /opt/dokku/YOUR_APP_NAME/uploads on the server. So everytime the application writes something to the PROJECT_ROOT/uploads it will in fact write to the /opt/dokku/YOUR_APP_NAME/uploads outside of the container. That way your files will not be destroyed by next deploy.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.