ddev / ddev

Docker-based local PHP+Node.js web development environments
https://ddev.com
Apache License 2.0
2.77k stars 606 forks source link

Add `-s, --service` argument to ddev launch #5700

Closed timkelty closed 3 months ago

timkelty commented 10 months ago

Is there an existing issue for this?

Is your feature request related to a problem?

Services often have their own web UIs, which are shown via ddev describe, but not available to ddev launch

Describe your solution

Like ddev exec, it would be nice if one could do:

ddev launch -s minio
ddev launch -s mailpit # would be equivalent to `ddev launch -m`

Describe alternatives

No response

Additional context

No response

jonaseberle commented 10 months ago

In my understanding the --service refers to a container which is part of a docker-compose project. docker-compose uses the word "service" for that. "mailpit" is currently not a service in that sense but merely a program that runs in the "web" container.

"launch" opens an URL.

A service does not necessarily have a URL. DDEV could check if it published any ports via the router (by looking into the HTTP(S)_EXPOSE env settings) and could theoretically launch the first one? I think your wish is conceptually a bit difficult but I might overlook something.

Note: We have now a command ddev mailpit as alias for ddev launch -m (#5642)

tyler36 commented 10 months ago

I'm working on PR #5525 that will allow you to use ddev port 3000 to open a specific port. This will make custom commands and alias much easier to develop.

timkelty commented 10 months ago

Thanks for the clarification – in my case (ignoring my mailpit example), I am trying to launch URL from a docker-compose service (defined by HTTP(S)_EXPOSE).

Sounds like this is by design, so for now I'll just do this by defining a separate custom command.

rfay commented 3 months ago

ddev launch has in fact been updated to take ports, for example, so ddev launch :8037, which gets you part of the way there.