Before I go editing any docker files, I wanted to put my thought process out there to the community. I've seen/read quite a few posts today on DO storage and Docker, some quite old at this point. I think I have an understanding of how the preferred (by Docker) method is executed.
Steps:
- I've created a volume in the DO control panel, gave it a name and let the control panel format and mount it to my droplet.
- DO had a nifty "Config instructions" with a bash command to add a mount point in /etc/fstab so the mount would persist upon host restarts.
- I rebooted the host and did a 'findmnt /mnt/mynewvolume', it was mounted successfully on restart.
I want /mnt/mynewvolume to be the location where /public/videos (User Uploads Folder) are saved. I've already configured this (/public/videos) in Wappler's Project Options and have been using /public/videos successfully with my API's in dev and staging environments.
- I created the public/videos folders at this new mount point (as root): /mnt/mynewvolume/public/videos
I've located the docker-compose.yml file for my remote ('DO Staging') server within the .wappler folder structure. Currently for the web service, the yml file says:
volumes:
- 'user_uploads:/opt/node_app/public/videos:rw'
On my remote server, a 'docker volume inspect' command reveals that the "user_uploads" is mounted on the host at: /var/lib/docker/volumes/myproject_user_uploads/_data. Is it just a matter of updating my staging target's docker-compose.yml file to:
volumes:
user_uploads:/mnt/ffuser_fcc/public/videos:rw
Is this all that's necessary?
and congrats Wappler team on another fine update