[SOLVED] How to create volume? and connect to my container?
Hi everyone,
I'm still confused about how to use volumes in dokploy.
in this case, I have a nestjs application. I have 1 endpoint to upload images. if on my local computer, the uploaded image goes to public/
if my application in dokploy has a problem and i want to redeploy it, the uploaded image will not be lost.
that's why I need to create a volume, how do I create a volume in dokploy? and how do I connect my container to that volume?
6 Replies
You have 2 options for this case, use Bind Mount or Volume Mount
1 Option:
Bind Mount will make a folder from your host map to a specific folder or route inside the container
eg:
Host Path
/etc/dokploy/images
Mount Path:
I suggest to terminal the container to see all the folders are created inside the container and then use a specific folder
eg: /app/src/ .....
2 Option:
Just set a volume name random it can be whatever name
Mount Path:
The same as I said above
eg: /app/src/ .....
Differences? if you use the first option the only way you will lose the information is if you manually delete the host path, in the second option if for some reason you clean the docker volumes and you forget to do so, you may lose the information
For the first option, host path is the OS Path?
I mean if I use Ubuntu, the host path is Ubuntu it self?
when I mean the host path I refer any path path you want
it can be /etc, /var, /home
and yes the host path is on the machine directly
I did something similar but for a sqlite database here https://discord.com/channels/1234073262418563112/1234075018850205856/1257409351447089232
Ohh, i see...
Okay, I'll try that
Thanks you @Siumauricio . Btw i love dokploy 👌
Thank you, appreciate! ❤️
I just had time to try the method above, but i'm facing error like this.

