coollabsio / coolify

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

[Bug]: Failed to Recognize Reference #2362

Open volfadar opened 1 month ago

volfadar commented 1 month ago

Description

i use docker-compose way for deploying Mautic, the templates is come from this repo https://github.com/mautic/docker-mautic/blob/6ebb1d6a2751fbb029d1e5ebb6c9ae076f55d47f/examples/basic/docker-compose.yml#L4

i think there's no problem with their config, but Coolify seems failed to recognize the reference of "*mautic-volumes" which is already highlighted in the link above (line 4)

image

Minimal Reproduction (if possible, example repository)

stated above

Exception or Error

Reference "mautic-volumes" does not exist at line 6 (near "volumes: *mautic-volumes").

Version

Latest - v4.0.0-beta.294

andrasbacsai commented 1 month ago

This is a tricky issue. Docker compose is not a standard yaml file, so to be able to parse it, I need some kind of special docker/yaml parser, which is not available anywhere.

I will think about how this could be solved. Until then here is a cleaned up compose file:

services:
  db:
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes: 
      - mysql-data:/var/lib/mysql
    healthcheck:
      test: mysqladmin --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD ping
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 10

  mautic_web:
    image: mautic/mautic:5-apache
    ports:
      - 8001:80
    volumes: 
      - ./mautic/config:/var/www/html/config:z
      - ./mautic/logs:/var/www/html/var/logs:z
      - ./mautic/media/files:/var/www/html/docroot/media/files:z
      - ./mautic/media/images:/var/www/html/docroot/media/images:z
      - ./cron:/opt/mautic/cron:z
    environment:
      - DOCKER_MAUTIC_LOAD_TEST_DATA=${DOCKER_MAUTIC_LOAD_TEST_DATA}
      - DOCKER_MAUTIC_RUN_MIGRATIONS=${DOCKER_MAUTIC_RUN_MIGRATIONS}
    healthcheck:
      test: curl http://localhost
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 100
    depends_on:
      db:
        condition: service_healthy

  mautic_cron:
    image: mautic/mautic:5-apache
    volumes: 
      - ./mautic/config:/var/www/html/config:z
      - ./mautic/logs:/var/www/html/var/logs:z
      - ./mautic/media/files:/var/www/html/docroot/media/files:z
      - ./mautic/media/images:/var/www/html/docroot/media/images:z
      - ./cron:/opt/mautic/cron:z
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_cron
    depends_on:
      mautic_web:
        condition: service_healthy

  mautic_worker:
    image: mautic/mautic:5-apache
    volumes: 
      - ./mautic/config:/var/www/html/config:z
      - ./mautic/logs:/var/www/html/var/logs:z
      - ./mautic/media/files:/var/www/html/docroot/media/files:z
      - ./mautic/media/images:/var/www/html/docroot/media/images:z
      - ./cron:/opt/mautic/cron:z
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_worker
    depends_on:
      mautic_web:
        condition: service_healthy

volumes:
  mysql-data:
volfadar commented 1 month ago

This is a tricky issue. Docker compose is not a standard yaml file, so to be able to parse it, I need some kind of special docker/yaml parser, which is not available anywhere.

thanks @andrasbacsai, so simply, just hard code that to every references instead making reference, right?

image one more question, should i uncheck this checkbox?

andrasbacsai commented 1 month ago

Well, you can delete the double $ and left the checkbox active, or uncheck and leave the compose file like that.