Node-config custom-environment-variables not Picking Docker environment Variablesnodejs sequelize/cli how to use with node-configGetting node-config related typescript error when compilingNode-config global configurationnode-config multiple configuration filesHow does one include Heroku environment variables using node-config?NodeJS - config cannot not load custom environment variablesHow to use node-config in typescript?How to mutate node-config in memorycan't access .env with node-config

What verb for taking advantage fits in "I don't want to ________ on the friendship"?

How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?

Why don't we add Wilson loops to the SM Lagrangian?

Is it okay to fade a human face just to create some space to place important content over it?

Sharing referee/AE report online to point out a grievous error in refereeing

Thin wall to block LED light from hitting photodiode?

Are gliders susceptible to bird strikes?

Journal standards vs. personal standards

How Do I Know When I am in Private Mode?

Company threatening to call my current job after I declined their offer

If two black hole event horizons overlap (touch) can they ever separate again?

How to describe POV characters?

Preferred word for "preferred", "target", "chosen" in end user support documentation

Movie with Zoltar in a trailer park named Paradise and a boy playing a video game then being recruited by aliens to fight in space

Closest Proximity of Oceans to Freshwater Springs

I hit a pipe with a mower and now it won't turn

Which is better for keeping data: primary partition or logical partition?

13th chords on guitar

Prime parity peregrination

Most elegant way to write a one-shot 'if'

The warming up game

Why were the first airplanes "backwards"?

How to properly say asset/assets in German

Could human civilization live 150 years in a nuclear-powered aircraft carrier colony without resorting to mass killing/ cannibalism?



Node-config custom-environment-variables not Picking Docker environment Variables


nodejs sequelize/cli how to use with node-configGetting node-config related typescript error when compilingNode-config global configurationnode-config multiple configuration filesHow does one include Heroku environment variables using node-config?NodeJS - config cannot not load custom environment variablesHow to use node-config in typescript?How to mutate node-config in memorycan't access .env with node-config






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Working on Windows OS.



My node app using node-config isn't using docker environment variables. It's always using the default config.



I am using node-config custom environment variables as described here: https://github.com/lorenwest/node-config/wiki/Environment-Variables#custom-environment-variables



Everything is working well when running the app locally. The config by passes the default ones and takes the ones defined in my User variables when set.



Problem



  • I start a docker instance with all required Environment variables
    set.

  • I verify the env variables by running docker exec container_name env

However, the node app still uses the default config, instead of the environment variables.



I am not sure what setup I may be missing.










share|improve this question






















  • sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

    – NickW
    Jan 29 at 13:03


















1















Working on Windows OS.



My node app using node-config isn't using docker environment variables. It's always using the default config.



I am using node-config custom environment variables as described here: https://github.com/lorenwest/node-config/wiki/Environment-Variables#custom-environment-variables



Everything is working well when running the app locally. The config by passes the default ones and takes the ones defined in my User variables when set.



Problem



  • I start a docker instance with all required Environment variables
    set.

  • I verify the env variables by running docker exec container_name env

However, the node app still uses the default config, instead of the environment variables.



I am not sure what setup I may be missing.










share|improve this question






















  • sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

    – NickW
    Jan 29 at 13:03














1












1








1








Working on Windows OS.



My node app using node-config isn't using docker environment variables. It's always using the default config.



I am using node-config custom environment variables as described here: https://github.com/lorenwest/node-config/wiki/Environment-Variables#custom-environment-variables



Everything is working well when running the app locally. The config by passes the default ones and takes the ones defined in my User variables when set.



Problem



  • I start a docker instance with all required Environment variables
    set.

  • I verify the env variables by running docker exec container_name env

However, the node app still uses the default config, instead of the environment variables.



I am not sure what setup I may be missing.










share|improve this question














Working on Windows OS.



My node app using node-config isn't using docker environment variables. It's always using the default config.



I am using node-config custom environment variables as described here: https://github.com/lorenwest/node-config/wiki/Environment-Variables#custom-environment-variables



Everything is working well when running the app locally. The config by passes the default ones and takes the ones defined in my User variables when set.



Problem



  • I start a docker instance with all required Environment variables
    set.

  • I verify the env variables by running docker exec container_name env

However, the node app still uses the default config, instead of the environment variables.



I am not sure what setup I may be missing.







node-config






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 12 '18 at 22:40









SumatanJuniorSumatanJunior

195 bronze badges




195 bronze badges












  • sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

    – NickW
    Jan 29 at 13:03


















  • sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

    – NickW
    Jan 29 at 13:03

















sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

– NickW
Jan 29 at 13:03






sorry this isn't an answer to your problem, but I have this exact issue with Heroku. the custom-environment-variables don't override the default or production json files

– NickW
Jan 29 at 13:03













1 Answer
1






active

oldest

votes


















1














I'm a maintainer of node-config. I don't test with Docker or Heroku, but this most be an ordering problem. As long as the environment variables are set before require('config') happens, they will work-- at that point Docker or Heroku doesn't matter. The activity is happening inside the Node.js JavaScript engine at that point.



Try this simple test: Just before your line where you require('config'), use console.log or an equivalent to print out the environment variables that you care about. I expect you'll find that when it's not working it's because the environment variables are not set before node-config is loaded.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53752475%2fnode-config-custom-environment-variables-not-picking-docker-environment-variable%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I'm a maintainer of node-config. I don't test with Docker or Heroku, but this most be an ordering problem. As long as the environment variables are set before require('config') happens, they will work-- at that point Docker or Heroku doesn't matter. The activity is happening inside the Node.js JavaScript engine at that point.



    Try this simple test: Just before your line where you require('config'), use console.log or an equivalent to print out the environment variables that you care about. I expect you'll find that when it's not working it's because the environment variables are not set before node-config is loaded.






    share|improve this answer



























      1














      I'm a maintainer of node-config. I don't test with Docker or Heroku, but this most be an ordering problem. As long as the environment variables are set before require('config') happens, they will work-- at that point Docker or Heroku doesn't matter. The activity is happening inside the Node.js JavaScript engine at that point.



      Try this simple test: Just before your line where you require('config'), use console.log or an equivalent to print out the environment variables that you care about. I expect you'll find that when it's not working it's because the environment variables are not set before node-config is loaded.






      share|improve this answer

























        1












        1








        1







        I'm a maintainer of node-config. I don't test with Docker or Heroku, but this most be an ordering problem. As long as the environment variables are set before require('config') happens, they will work-- at that point Docker or Heroku doesn't matter. The activity is happening inside the Node.js JavaScript engine at that point.



        Try this simple test: Just before your line where you require('config'), use console.log or an equivalent to print out the environment variables that you care about. I expect you'll find that when it's not working it's because the environment variables are not set before node-config is loaded.






        share|improve this answer













        I'm a maintainer of node-config. I don't test with Docker or Heroku, but this most be an ordering problem. As long as the environment variables are set before require('config') happens, they will work-- at that point Docker or Heroku doesn't matter. The activity is happening inside the Node.js JavaScript engine at that point.



        Try this simple test: Just before your line where you require('config'), use console.log or an equivalent to print out the environment variables that you care about. I expect you'll find that when it's not working it's because the environment variables are not set before node-config is loaded.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 14:10









        Mark StosbergMark Stosberg

        9,2195 gold badges29 silver badges45 bronze badges




        9,2195 gold badges29 silver badges45 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53752475%2fnode-config-custom-environment-variables-not-picking-docker-environment-variable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript