dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Unable to customize mount volumes.

Open SheldonLiu0412 opened this issue 2 years ago • 8 comments

To Reproduce

image

Current vs. Expected behavior

I have set a custom mount path for the volume, but no matter how I try, the storage still goes to a default path: /var/lib/docker/volumes/n8n-n8n-93ecd0_n8n_data.

Provide environment information

CentOS Linux release 7.9.2009 (Core)
Linux version 3.10.0-1160.119.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jun 4 14:43:51 UTC 2024

Which area(s) are affected? (Select all that apply)

Application

Additional context

No response

SheldonLiu0412 avatar Sep 30 '24 07:09 SheldonLiu0412

Hi, can you describe more in detail what are you expecting and what are you trying to achieve?

When you create File volumes it goes to /etc/dokploy/[app or compose]/appName/files

Siumauricio avatar Sep 30 '24 07:09 Siumauricio

Thank you for your response, this is not a real bug, I will close the issue. @Siumauricio

SheldonLiu0412 avatar Oct 01 '24 03:10 SheldonLiu0412

@Siumauricio Hi, if I select database to deploy, the volume will in /var/lib/docker in default. However, I hope to store all data from database into the non-system disk. How to do? create a soft link for docker or volume dir?

QThans avatar Nov 08 '24 20:11 QThans

Sorry for necroposting but I have the same problem. I want to keep the file for my docker compose volume in a folder outside the /etc/dokploy for external reasons. Is there a way to rebind where "../files" points?

eisterman avatar Apr 26 '25 13:04 eisterman

Sorry for necroposting but I have the same problem. I want to keep the file for my docker compose volume in a folder outside the /etc/dokploy for external reasons. Is there a way to rebind where "../files" points?

Have you figured out a solution for that?

JhonatanPereira avatar May 10 '25 23:05 JhonatanPereira

Well I figured out that creating volumes for files with the mount path set to. ie. nginx.conf or ./nginx.conf always created directories... So I just named the volumes for configuration files to something like: nginx.txt and then in the docker-compose you'll need to reference them like:

   volumes:
      - ../files/nginx.txt:/etc/nginx/nginx.conf:ro

...only then it worked in my case.

The documentation also did help to figure out the 'files' path you'll need to use.

heijmerikx avatar May 11 '25 18:05 heijmerikx

I’m having problems mounting repository files with the following volume definitions:

 volumes:
      - odoo-data:/var/lib/odoo
      - ./:/mnt/extra-addons/va_subscription_18
      - ./docker/config/odoo.conf:/etc/odoo/odoo.conf

The container runs, but the files and directories from the repo are not visible inside. This only happens when deployed via Dokploy AutoDeploy from Bitbucket. It works fine locally and even on the same server when using docker compose up manually.

sotoplatero avatar May 18 '25 14:05 sotoplatero

Well I figured out that creating volumes for files with the mount path set to. ie. nginx.conf or ./nginx.conf always created directories... So I just named the volumes for configuration files to something like: nginx.txt and then in the docker-compose you'll need to reference them like:

   volumes:
      - ../files/nginx.txt:/etc/nginx/nginx.conf:ro

...only then it worked in my case.

The documentation also did help to figure out the 'files' path you'll need to use.

This also works for React nixpacks deploy for SPA routing refresh/deep link. You can mount the file in the UI so mine looks like this File Path: nginx.txt Mount Path: /etc/nginx/conf.d/default.conf Content: ... original .... location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html; # key line to make React Router Work } .... original ....

Thank you -> @heijmerikx !!

I have been looking for this for a couple days and tried every answer on the internet / LLM. Found another answer but it said thats easy just mount a file lol. I am going to find that one and link it to this one.

JoshuaMichaelHanson avatar Nov 14 '25 15:11 JoshuaMichaelHanson