coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.5k stars 1.88k forks source link

[Bug]: can't mount volumes with external drivers in compose files #3303

Open RayBB opened 2 months ago

RayBB commented 2 months ago

Description

When I try to mount a volume from an external driver (rclone in this case) it doesn't work. It just shows an empty folder.

more info at https://rclone.org/docker/

Minimal Reproduction (if possible, example repository)

sudo mkdir -p /var/lib/docker-plugins/rclone/config
sudo mkdir -p /var/lib/docker-plugins/rclone/cache

ln -s ~/.config/rclone/rclone.conf /var/lib/docker-plugins/rclone/config

## Choose the right tag here for your machine
docker plugin install rclone/docker-volume-rclone:arm64 \
  --alias rclone \
  --grant-all-permissions \
  args="-v --allow-other"
docker plugin enable rclone

docker volume create rclone-http -d rclone -o type=http -o http-url=https://beta.rclone.org/test/

# See it working by opening that folder in filebrowser locally without coolify
docker run --rm \
  -v rclone-http:/srv/httptesting \
  -p 8888:80 \
  -e FB_NOAUTH=noauth \
  --name filebrowser filebrowser/filebrowser:latest

However, it doesn't work when we use a compose file in coolify

services:
  filebrowser:
    image: 'filebrowser/filebrowser:latest'
    environment:
      - SERVICE_FQDN_FILEBROWSER2
      - PUID=1000
      - PGID=1000
      - FB_NOAUTH=noauth
    volumes:
      - 'rclone-http:/srv/httptesting'
volumes:
  rclone-http:
    external: true

I just get an empty folder.

I think this is a bug.

Exception or Error

No response

Version

v4.0.0-beta.323

Cloud?

RayBB commented 2 months ago

Actually, I think it's just that external volumes aren't supported in general.

If I try to inline the external part like so:

services:
  filebrowser:
    image: 'filebrowser/filebrowser:latest'
    environment:
      - SERVICE_FQDN_FILEBROWSER2
      - PUID=1000
      - PGID=1000
      - FB_NOAUTH=noauth
    volumes:
      - type: volume
        source: rclone-http
        target: /srv/httptesting
        external: true

I get this error:

validating /data/coolify/services/c88wks0cgc0kgwcooo8sscgg/docker-compose.yml: services.app.volumes.2 Additional property external is not allowed

kmbuthia commented 2 months ago

I just ran into volume mount issues as well. This used to work...but as of version 4.0.0-beta.331 there seems to be issues with volume mounts. In my case, using Coolify version 4.0.0-beta.331 no longer allows me to do a file mount.

docker-compose.yml snippet below

volumes:
  - './path/to/file:/path/to/file/in/image'

The above no longer works as of version 4.0.0-beta.331

My current workaround: Downgraded back to version 4.0.0-beta.323 FYI @andrasbacsai

brandnewx commented 2 months ago

Docker Compose deployment is broken in different places since 324. Dev(s) should look at this more carefully because each fix only introduces another bug. Probably need a test unit here.

RayBB commented 1 month ago

Tagging @peaklabs-dev with this as I hope we could get it fixed before stable. If not fixed at a minimum a warning in the UI would be great.

If this is fixed I'll happily add docs for how to use this. I think it's a really great fit with the mission of coolify because it's easy to have a cheap VPS but when your storage is limited that can be quite a pain. Being able to use external storages with rclone let's you mount S3 or Google drive or Dropbox or whatever for a scrappy solution that can give you a few TB of storage easily :)

renatoaraujoc commented 4 weeks ago

Volumes in 4.360 are completely broken.

The issue here is that Coolify is trying to be "too automatic" and is messing things up big time.

In my use case, I have several zfs pools with datasets configured specifically for each sort of service, they're outside the root file-system (where docker runs), so I need to create volumes on different mountpoints and have compose to point to these volumes, its impossible today.

I don't know what to do.

cankanoa commented 6 days ago

I have the same issue. I'm trying to mount a file like this './volumes/logs/vector.yml:/etc/vector/vector.yml:ro' but it mounts as a directory and wont work.