Use env variables as alternative to ormconfig.json

I suggest implement check does env variable provided and use it.

If process.env.DB_TYPE === ‘postgres’ => then cp ormconfig.postgres.json to root and fill it by process.env.DB_USERNAME, process.env.DB_PASSWORD e.t.c

it will help host application on SaaS platforms, where you cannot edit application files in runtime.

you can already use env values for db https://typeorm.io/#/using-ormconfig/using-environment-variables

Yes, but part of bot systems still user json file.


e.t.c

This is already fix in progress https://github.com/sogehige/sogeBot/issues/3328

Can you also add those variables to docs and change docker-compose.yml to use those variables instead of mounted file?

you can already do it. Preferred way is to use ormconfig.json

nevermind, we will need to move to ENV variables, I cannot get other files to have working.

actually now it will work everything :wink:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.