-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As a developer, I can easily access service ports #691
Comments
The Drupal configuration currently has
This should be renamed to |
However CreateSettingsFile is only called on import db... not when ddev config runs. |
I had a discussion with @mglaman at Midcamp. There are two segments to this feature.
The first should be an easy lift. The second has some implications across CMSes. Let me know if that would hit your use case. I'm assuming it's likely that end-users will need to modify DB settings file per project to make this work. However, I'm open to discuss in more detail to see how viable the second part is. |
|
It does. Currently I have
But the idea would be to not run shell_exec each time. I guess via hooks I could echo that to a JSON file and just load that instead. |
Your hook would have to clean up the file when you did an 'rm', because it would then be the wrong port (likely) on start. |
Well each start would reset the file. |
I’m long overdue to drive this one to AC. I’ll commit to COB Monday. |
So this is an initial set of thoughts that may sane or not. But I see a few different ways this could be achieved in order to meet the goals during various use cases. Problem Statement:
Please ignore any syntax errors. The point is more of trying to determine a way to make this programmable and fixed from a usage perpsective while allowing ports to change to avoid collisions. |
|
Feature request:
As a developer, I wish to easily access the ports for my app services.
What you expected to happen:
Currently, we have to type
ddev describe
to see ports for our connected services and database information. As a developer, I would like my tooling to easily know these ports for custom commands or a custom bootstrap process of my CMS on the host.ddev start
, my service ports are mapped to.ddev/ports.json
ddev stop
my service port maps are removed.ddev/ports.json
This would allow Solr, MySQL/Maria, Elastic, Redis support on host command line. I picked JSON because it's most easy thing to serialize/unserialize across languages.
So regardless if WP-CLI, Drush, Console, whatever. Each CMS can support a host settings.
I would like to have a generated
ports.json
in the.ddev
folder. This would resemble the following:Each time the command is run and containers are brought up, this is updated.
This would allow me to easily customize settings to read the port from my host and allow execution of tooling on my host, instead of
ddev exec
.This is beneficial so that I can run Blackfire.io profiling and Xdebug on my commands.
Why
ports.json
? Because my current workflow involves something like thisThat means each time the settings are loaded it executes a
docker inspect
which isn't performant and requires specific container naming. But sinceddev
controls the containers we can trust the file will be built properlyI picked JSON because it is the most common format that can be serialized/unserialized across languages (without external libraries.)
Anything else do we need to know:
Related source links or issues:
This was inspired by / relates to #454
My WordPress setup: https://github.com/mglaman/platform-docker/tree/develop/resources/stacks/wordpress
My Drupal setup: https://github.com/mglaman/platform-docker/tree/develop/resources/stacks/drupal8
Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)
3
The text was updated successfully, but these errors were encountered: