A site (no composer, else I'd do it there) has a few symlinks inside the container that are required for it to work.
How do I tell ddev to create those symlinks on ddev start
?
I'm sure it's right before my eyes, but I don't find it. Google gives me nothing, maybe the answer is too obvious? Do a ln -s
on first run?
First, I would probably create the symlink in my repo and check it into git. This would have problems on Windows (but symlinks in general are risky on Windows).
You'll want to use relative symlinks so that the relative path can be followed either inside the container or on the host.
So, use a post-start hook with exec (to do it inside the web container) if you have to:
hooks:
post-start:
- exec: ln -sf ../vendor/bin/behat behat
Or (especially if you're not on Windows) you could also do it on the host with either a pre-start or post-start hook:
hooks:
pre-start:
- exec-host: ln -sf ../vendor/bin/behat behat
Beware that the default directory for exec
in the web container is not necessarily the project root, it may be the docroot (as it is with Drupal).