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
CLI v5.8.12 (still) does not create the proper env var for MongoDB! #451
Comments
The logic that parses the Docker configuration for MongoDB is here: https://github.com/symfony-cli/symfony-cli/blob/main/envs/docker.go#L401 and the logic to use that information to create env vars is here: https://github.com/symfony-cli/symfony-cli/blob/main/envs/docker.go#L401 As I'm not a MongoDB user myself, I'm not sure what should be changed there. @malhusseiny Can you help me? |
Here is the line that needs to be changed: https://github.com/symfony-cli/symfony-cli/blob/main/envs/envs.go#L242 In order to create the correct values[fmt.Sprintf("%sURL", prefix)] = fmt.Sprintf("%s://%s:%s@%s:%s", endpoint["scheme"].(string), endpoint["username"].(string), endpoint["password"].(string), endpoint["host"].(string), formatInt(endpoint["port"])) such that the value of |
But here, you've completely removed the "path", which looks wrong to me. But then again, I'm not a MongoDB user, so ideally, I'd like others to chime in here. |
A MongoDB service with the following docker-compose configuration in
compose.yml
:causes the variables
MONGO_DATABASE
,MONGO_DB
,MONGO_NAME
to be set tosymfony
, which is fine. However, it also sets theauthSource
param ofMONGO_URL
tosymfony
as shown below:Without the
MONGO_INITDB_DATABASE: ${MONGODB_DB:-symfony}
in the docker compose file, all database-related environment variables as well as theauthSource
param become empty. It would be great if you could untangle that coupling.The text was updated successfully, but these errors were encountered: