coollabsio / coolify

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

[Bug]: Coolify fails to handle docker compose files with single file volumes #3056

Closed ldoo22 closed 1 week ago

ldoo22 commented 1 month ago

Description

I've encountered an issue when working with Docker Compose files that have a container using 'volumes' to mount a single file instead of a directory with "Preserve Repository During Deployment" option enabled.

Minimal Reproduction (if possible, example repository)

An example with a Caddy container, where one should load a config file (Caddyfile) onto the container: Repository file structure:

docker-compose.yml
Caddyfile

In docker-compose-yml file:

services:
  caddy:
    image: caddy
    ports:
      - 2015:2015
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile

In Caddyfile file:

:2015
respond "Hello, world!"

In coolify with "Preserve Repository During Deployment" option enabled: image

Press "Deploy"

Exception or Error

At deployment logs:

Oops something is not okay, are you okay? 😢

cannot overwrite directory "/data/coolify/applications/<app_id>/Caddyfile" with non-directory "/data/coolify/applications/<app_id>"

It seems to me that it considers that file as a directory.

Version

v4.0.0-beta.323

Cloud?

andrasbacsai commented 1 month ago

This will be fixed in the upcoming version.

I will also add a new functionality, that you can set for each storage resource, if you would like to sync it from git or manually set it on Coolify's UI. If you check that you would like to preserve your git repository during deployment, each storage that is defined in your compose file, will be based on your git. And then you can simple override this on the UI.

So in your example, ff you would like to quickly override your Caddyfile, you just set it in the storage view and redeploy.

ldoo22 commented 1 month ago

Thank you! Amazing work!

danielehrhardt commented 3 weeks ago

This will be fixed in the upcoming version.

I will also add a new functionality, that you can set for each storage resource, if you would like to sync it from git or manually set it on Coolify's UI. If you check that you would like to preserve your git repository during deployment, each storage that is defined in your compose file, will be based on your git. And then you can simple override this on the UI.

So in your example, ff you would like to quickly override your Caddyfile, you just set it in the storage view and redeploy.

Awesome! :) pls release