lando / symfony

The Official Symfony Lando Plugin
https://docs.lando.dev/symfony/
GNU General Public License v3.0
6 stars 2 forks source link

Ability to Disable Database #19

Open GuyPaddock opened 1 year ago

GuyPaddock commented 1 year ago

We have a CLI-only (Symfony Console) project but would like to use Lando so that our dev environments are portable and XDEBUG works out of the box.

We don't need any database for this. Unfortunately, it doesn't seem like there's any way to disable the database component of this recipe. Would it be possible for a value like disabled, none, or off to be provided for database?

For clarification, I did try this but got ERROR: No such service: database:

name: my_project
recipe: symfony
services:
  database: disabled
brandonmcwhirter commented 1 year ago

@GuyPaddock this appears to have been added in 3.6.5 of Lando. I am able to disable the database service using the yaml above with the latest version of Lando (3.11.0).

Scanning to determine which services are ready... Please stand by...

   ___                      __        __        __     __        ______
  / _ )___  ___  __ _  ___ / /  ___ _/ /_____ _/ /__ _/ /_____ _/ / / /
 / _  / _ \/ _ \/  ' \(_-</ _ \/ _ `/  '_/ _ `/ / _ `/  '_/ _ `/_/_/_/
/____/\___/\___/_/_/_/___/_//_/\_,_/_/\_\\_,_/_/\_,_/_/\_\\_,_(_|_|_)

Your app has started up correctly.
Here are some vitals:

 NAME            my_project
 LOCATION        /home/brandon/projects/my_project
 SERVICES        appserver
 APPSERVER URLS  https://localhost:55765
                 http://localhost:55764
                 http://my_project.lndo.site/
                 https://my_project.lndo.site/
GuyPaddock commented 1 year ago

@brandonmcwhirter I am already running Lando 3.11.0. The disabled option works for initial spin-up, but it causes rebuilds to fail:

$ lando rebuild
? Are you sure you want to rebuild? Yes
Rising anew like a fire phoenix from the ashes! Rebuilding app...
Killing myproject_appserver_1 ... done
Going to remove myproject_appserver_1
Removing myproject_appserver_1 ... done
ERROR: No such service: database
ERROR ==>
wtflm commented 1 month ago

lando rebuild -s appserver -y works to specify appserver only, effectively skipping the problematic database service.