|
When reviewing the documentation, I learned about the For example, after installing the Redis add-on using: the service is not exposed to the host by default, so it cannot be accessed directly from the host machine. To expose it, I created an additional compose file:
services:
redis:
ports:
- "${REDIS_HOST_PORT:-6379}:6379"If I then create If I don’t set the variable, it defaults to I’m wondering whether there is a mechanism similar to One idea is to create a pre-start hook that runs on the host and manages
This works, but feels clumsy. Is there a better approach? A simpler option would be to create a This approach is also viable, but I’d like to know if there’s a more elegant built-in solution. |
Replies: 2 comments 4 replies
|
Why do you need to bind the port to the host? Are you using redis from something on the host? If something inside the DDEV/Docker network is using redis, there's no need to bind it to the host. ( |
Yes, it's simple: services:
redis:
ports:
- "${REDIS_HOST_PORT:-}:6379" |
Yes, it's simple: