ecotoneframework / ecotone-dev

Ecotone Framework Development - This is Monorepo which contains all official public modules
https://docs.ecotone.tech
Other
37 stars 16 forks source link

Allow to use env variables in Ecotone's Symfony Config #392

Closed dgafka closed 1 month ago

dgafka commented 1 month ago

Description

Allow to use env variables in Ecotone config for Symfony. It will now work for Symfony, just like it does for Laravel. Therefore the environment variables will be resolved during container build and use for preparing Ecotone's configuration.


Using environment variables is safe as long as container is build with expected variables. If we will for example build the container, dump it into Docker Image, and the run it in container with different environment variables - only the envs used during build will be used.

Type of change

Please delete options that are not relevant.

dgafka commented 1 month ago

cc: @lifinsky

lifinsky commented 1 month ago

@dgafka But env processors int:, bool:, etc will not work.

lifinsky commented 1 month ago

I once also wanted to make such an PR, but I didn’t like that it wouldn’t be possible to work with bool or int parameters in the config.

dgafka commented 1 month ago

@lifinsky this what we can achieve with reasonable amount of time. In general that would require refactor to make ServiceConfiguration an Service in DI, then we could inject any config to that at run time. Yet it means compile phase would need to change and not use it at all. Yet we do use it in order to make performance smoother as most of the configuration is basically done and ready to execute (no need for run time reconfigurations)

So at this moment, that's fair enough trade off, which will work for particular cases.

lifinsky commented 3 weeks ago

@dgafka #399