lando / lamp

The Official LAMP Lando Plugin
https://docs.lando.dev/lamp/
GNU General Public License v3.0
2 stars 8 forks source link

Multiplte instances with own configs #23

Closed Gokujo closed 4 months ago

Gokujo commented 1 year ago

I have two sites locally that I want to run in the same time. For each I have a config file.

Main site

name: dle152
recipe: lamp
config:
  php: 7.4
  xdebug: "debug,develop"
  database: mariadb:10.6
  webroot: .
services:
  database:
    portforward: 3307
    creds:
      user: mysql
      password: mysql
      database: dle152
  appserver:
    build_as_root:
      - export PHP=7.4 && export IC_SO="ioncube_loader_lin_$PHP.so" && export PHP_EXT_DIR=`php-config --extension-dir` && cd /tmp && curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && tar -xvvzf ioncube.tar.gz && mv "ioncube/$IC_SO" $PHP_EXT_DIR && rm -Rf ioncube.tar.gz ioncube && echo "zend_extension=$PHP_EXT_DIR/$IC_SO" > /usr/local/etc/php/conf.d/00_docker-php-ext-ioncube_loader.ini
    overrides:
      environment:
        XDEBUG_CONFIG: "idekey='PHPSTORM' start_with_request=trigger discover_client_host=true log=/home/maximharder/Development/logs/xdebug.log"
        PHP_IDE_CONFIG: "serverName=dle152local"
        XDEBUG_SESSION_START: lando

proxy:
  appserver:
    - dle152.local

Other site

name: dleapi
recipe: lamp
config:
  php: 7.4
  xdebug: "debug,develop"
  database: false
  webroot: .
services:
  appserver:
    overrides:
      environment:
        XDEBUG_CONFIG: "idekey='PHPSTORM' start_with_request=trigger discover_client_host=true log=/home/maximharder/Development/logs/xdebug.log"
        PHP_IDE_CONFIG: "serverName=dleapi"
        XDEBUG_SESSION_START: lando

Both configurations are on separate paths. I tried to rebuild/start but got this error:

Unhandled rejection TypeError: undefined is not a function
    at getConfigDefaults (/snapshot/cli/node_modules/@lando/core/plugins/lando-recipes/types/laemp/builder.js)
    at new LandoLaemp (/snapshot/cli/node_modules/@lando/core/plugins/lando-recipes/types/laemp/builder.js)
    at new LandoLaravel (/snapshot/cli/node_modules/@lando/laravel/recipes/laravel/builder.js)
    at AsyncEvents.<anonymous> (/snapshot/cli/node_modules/@lando/core/plugins/lando-recipes/app.js)
    at AsyncEvents.handle (/snapshot/cli/node_modules/@lando/core/lib/events.js)
    at /snapshot/cli/node_modules/@lando/core/lib/events.js
From previous event:
    at AsyncEvents.emit (/snapshot/cli/node_modules/@lando/core/lib/events.js)
    at /snapshot/cli/node_modules/@lando/core/lib/app.js
From previous event:
    at App.init (/snapshot/cli/node_modules/@lando/core/lib/app.js)
    at /snapshot/cli/bin/lando.js
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at Object.<anonymous> (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1887:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1940:12)
    at node:internal/main/run_main_module:17:47

I think it has something to do with the same names (.lando.yaml). But I tried with different names like .lando.dle152.yml but I couldn't get it to work. I don't get what I did wrong.

Gokujo commented 1 year ago

Please close this issue. I found the problem. I set the database to false because I didn't want a new one.

reynoldsalec commented 4 months ago

Thanks for letting me know @Gokujo!