torfs-ict / lando-symfony
Lando development environment generator for Symfony
Installs: 1 321
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 3
Type:project
Requires
- php: ^7
- symfony/console: ^3.4|^4.1
- symfony/process: ^3.4|^4.1
- symfony/yaml: ^3.4|^4.1
Requires (Dev)
- matomo/ini: ^2.0
- symfony/dotenv: ^4.1
This package is auto-updated.
Last update: 2024-11-26 20:19:48 UTC
README
This composer package allows you to easily configure a Lando development environment for Symfony projects.
Instead of having to copy .lando.yml
for every project, you can start with a
clean lando.yml
file with only a few required settings. Using the builder you
can then generate the full .lando.yml
file which will actually be used to spin
up your development environment.
Development environment info
Included services
- Nginx webserver
- PHP 7.1 (Xdebug ready)
- MySQL database
- Node.js container
- Blackfire profiler
- phpMyAdmin
- ELK stack
- Mailhog
- Memcached
- Headless chrome
- Unoconv
- PDFtk
Included Lando tooling
sf
: Run Symfony console commands- target: PHP
- alias for:
$ php bin/console
- example:
$ lando sf about
diff
: Generate a database migration by comparing your current database to your mapping information- target: PHP
- alias for:
$ php bin/console doctrine:migrations:diff
- example:
$ lando diff
migrate
: Execute a database migration to a specified version or the latest available version- target: PHP
- alias for:
$ php bin/console doctrine:migrations:migrate
- example:
$ lando migrate prev
cache
: Clears the Symfony cache- target: PHP
- alias for:
$ php bin/console cache:clear
- example:
$ lando cache
warmup
: Warms up an empty cache- target: PHP
- alias for:
$ php bin/console cache:warmup
- example:
$ lando warmup
blackfire
: Profile a Symfony console command using blackfire- target: PHP
- alias for:
$ blackfire run php bin/console
- example:
$ lando blackfire about
yarn
: Run the Yarn package manager- target: Node.js
- alias for:
$ yarn
- example:
$ lando yarn add bootstrap
encore
: Runs Webpack Encore- target: Node.js
- alias for:
$ node_modules/.bin/encore
- example:
$ lando encore dev --watch
Usage
Installing
Install the package with composer, and make sure to have a .env
file in
your project root containing all variables defined in .env.dist.
$ composer require --dev torfs-ict/lando-symfony
Setting up
A sample lando.yml
file can be found in lando.yml.dist.
If this file doesn't exist, you can have the builder create one for you.
name: my-project proxy: nginx: - "my-project.dev.local.torfs.org" mailhog: - "my-project.mhg.local.torfs.org" phpmyadmin: - "my-project.pma.local.torfs.org" elk: - 'my-project.elk.local.torfs.org:5601' tooling: worker: service: appserver description: Runs the background worker broker cmd: php bin/console app:worker --no-debug -vvv
Required settings
The only mandatory settings are the project name
and proxy
domains. Should your
project have removed a pre-defined service, you should omit this from the proxy
configuration as well.
Customizing the environment
When building the environment, your lando.yml
file will be merged with the
default configuration file, so you can customize as you see fit.
Removing services
Should you want to remove a service, you can simple set it to null
in your
lando.yml
file. The example below illustrates how to remove the elk
service.
Do note that if you remove a service which requires a proxy domain, you need to
remote the service from the proxy
settings as well.
name: my-project proxy: nginx: - "my-project.dev.local.torfs.org" mailhog: - "my-project.mhg.local.torfs.org" phpmyadmin: - "my-project.pma.local.torfs.org" services: elk: ~
Building the environment
Once your lando.yml
and .env
files are in place (or at least the .env
file)
you can generate the actual .lando.yml
file by running the build script.
$ vendor/bin/lando