My ddev environment always runs in production mode. How to change that?
SetEnv TYPO3_CONTEXT Development
Just for those who stumble upon this question here.
In newer versions of ddev (I have v1.17.5), you have to edit the file .ddev/config.yaml with nano o.e.
You can just replace the line
web_environment: []
by
web_environment:
- TYPO3_CONTEXT=Development
Afterwards you have to restart the environment via ddev restart
You can also use a specific Development Context for Local development.
web_environment:
- TYPO3_CONTEXT=Development/DDEV
vs
web_environment:
- TYPO3_CONTEXT=Development/YourHoster
to use another siteconfig for example.
Edit 2023-04-25: There are now many ways to set environment variables that don't require any of this. You can use a .ddev/.env, or add an environment variable to web_environment, etc. See https://ddev.readthedocs.io/en/latest/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container
The answer by @marcel is better these days.
Original answer:
There's an easier way that doesn't involve such complexity.
Create a .ddev/docker-compose.typo3.yaml with these contents:
services:
web:
environment:
- TYPO3_CONTEXT=Development
This does nothing beyond adding that environment variable in the web container. Note that the name of the docker-compose file is not important, it could be docker-compose.envstuff.yaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With