Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: v4 Git repo with Build Pack: Docker Compose: volumes created with wrong name #2168

Open
colinmollenhour opened this issue May 8, 2024 · 0 comments
Assignees

Comments

@colinmollenhour
Copy link

colinmollenhour commented May 8, 2024

Description

In normal Docker Compose (without Coolify), using a named volume means your volume will be created with the project name prepended to it. For example:

services:
  mariadb:
    image: mariadb
    volumes:
      mydb:/var/lib/mysql

Coolify v4 is changing the compose spec to look like this:

services:
  mariadb:
    image: mariadb
    volumes:
      oksgc84_mydb:/var/lib/mysql
volumes:
  oksgc84_mydb:
    name: oksgc84_mydb

This works fine when deploying a new resource with a raw Docker Compose spec. However, when deploying a resource from a Git repo with Build Pack: Docker Compose, it is turning into this:

services:
  mariadb:
    image: mariadb
    volumes:
      mydb:/var/lib/mysql
volumes:
  mydb:
    name: mydb

This is very bad because by adding name: mydb to the compose spec the volume is not created with any namespacing and then there is zero separation between projects so any two that use "Build Pack: Docker Compose" and a volume with "mydb" will have a conflict. I think Services would also be affected?

The UID needs to be added as a prefix to the rendered Compose file like it is for the raw Docker Compose deployment or the name: mydb not added so that Docker Compose can namespace the project volumes properly.

Minimal Reproduction (if possible, example repository)

Example repo here:
https://github.com/colinmollenhour/coolify-bug-report

Screenshot:
image

Exception or Error

No response

Version

v4.0.0-beta.276

@andrasbacsai andrasbacsai self-assigned this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants