Have you ever wanted to enable a serivce locally, but not on you CI? Need to quickly disable a service for debugging?
This handle little command lets you enable/disable a DDEV docker-compose
based service.
- Copy the
service
file into the DDEV commands directory.
To activate the command for all DDEV projects, copy it to your global DDEV config directory: ~/.ddev/commands/host
.
If you prefer to enable it on a per-project basis, copy it into the project commands directory: ./.ddev/commands/host
.
Note: If you have a copy in both locations, you will recieve a warning:
Project-level command 'service' is overriding the global 'service' command
EG. Lets assume you have ./.ddev/docker-compose.cypress.yaml
file that provides the cypress
service.
Type the following command to disable the service:
ddev service cypress disable
The file is renamed to ./.ddev/docker-compose.cypress.yaml.disabled
. It will no longer be read by DDEV on startup.
Type the following command to enable the service:
ddev service cypress enable
- If a service is updated, "enabled" or "disabled", DDEV will automatically restart to apply the changes.
- The service name is parsed from the file name;
docker-composer.goo.yaml
assumes the service is calledgoo
. - You can update the command variable
DISABLED_EXT
to change the disabled extension. Default is ".disabled
"
Contributed by @tyler36