10 Configuration
Danny edited this page 2025-04-25 11:27:42 +01:00

Configuration

By default, Loom Spinner provides a powerful environment for your PHP projects—no extra configuration required. However, Loom Spinner is designed to be flexible, so you can tailor your environment to suit different project needs.

For example, if you're building a CLI tool and don't need a web server, you can pass the --disable-server option to the spin:up command to exclude Nginx.

This page explains how to customize your environments using command line options or a project configuration file.

Important:
Configuration options and changes (including updates to spinner.yaml or CLI options) are only considered when you first build the environment with spin:up.

If you make changes to your configuration file or want to apply new settings after the containers have already been created, you must destroy (spin:down) and rebuild (spin:up) your environment for the changes to take effect.


Default Configuration

Every Loom Spinner environment starts with sensible defaults, defined in the default configuration file in the repository.


Custom Configuration

You can adjust your environment by:

  1. Passing options to the CLI: Override settings directly when you run the spin:up command.
  2. Creating a spinner.yaml config file: Place this file in your project root to define environment defaults.

Configuration Priority

When configuring, Loom Spinner checks for values in this order (highest to lowest):

  1. Command line options
  2. Values in your project's spinner.yaml
  3. The global defaults from the repository

For example:

If your spinner.yaml sets environment.database.enabled: true, but you run spin:up with --disable-database, the CLI flag takes precedence.


Example: Setting the MySQL Root Password

You can set the password for the MySQL root user (when the MySQL database is used) in your project configuration file:

options:
  environment:
    database:
      rootPassword: mySecretPassword

If this option is not provided, the rootPassword will be used from the default config.


Example: Disabling XDebug via YAML

If you're happy with most defaults but want to disable XDebug, your config might look like:

options:
  environment:
    php:
      xdebug: false

You can specify as many or as few options in spinner.yaml as needed.


Command Line Arguments

Most configuration options can also be supplied directly at the command line when creating your environment.


Available Options

Option Config Key Accepted Values
--php environment.php.version Any PHP version with a valid Docker FPM image
--disable-xdebug environment.php.xdebug: false CLI: none
YAML: true/false
--database - mysql, sqlite or sqlite3
--disable-database environment.database.enabled: false CLI: none
YAML: true/false
--disable-server environment.server.enabled: false CLI: none
YAML: true/false
--node environment.node.version Any valid Node.js version (e.g., 20)

For a comprehensive example of all options, see the config/spinner.yaml in the repository.


For more help with configuration, see the detailed Commands documentation and try different options to find the setup that best fits your project.