question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not setting NODE_ENV to production.

See original GitHub issue

Hey,

I have a project which is deployed to GAE and is using this image as base, but i want to deploy a dev version of this app.

I’ve created a simple app-dev.yaml file, which looks like this:

service: dev-api
runtime: custom
vm: true
threadsafe: false

env_variables:
  NODE_ENV: development

But it isn’t picked up by Dockerfile, is there any way to work around this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
JustinBeckwithcommented, Sep 20, 2016

Interesting - we’ll do some testing to figure out why this isn’t working. In the meantime - can you try setting the env var via your Dockerfile? Try adding this:

ENV NODE_ENV production

My guess is that we have a bug with the interaction between env vars set by Flex and env vars set in the base dockerfile.

1reaction
RawanHerzallahcommented, Mar 11, 2018

Hi, I’ve been trying to pass env_variables from the app.yaml with cutom runtime to the dockerFile and the value I read for it is empty, any advice ?

23:48:19 env_variables:
23:48:19   JETTY_ARGS: -Djava.util.logging.config.file=WEB-INF/flex.logging.properties
23:48:19   NODE_NAME: sre-testing-metricbeat

However, when i try to read its value i see it empty:

23:50:46 [INFO] GCLOUD: Step 14/21 : RUN echo "__________________ $NODE_NAME ____________"
23:50:46 [INFO] GCLOUD:  ---> Running in 41737ae048df
23:50:46 [INFO] GCLOUD: __________________  ____________
Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - How can I set NODE_ENV=production on Windows?
If you're in CMD (which is no longer maintained), use set NODE_ENV=production. This should be executed in the command prompt where you intend...
Read more >
NODE_ENV not set on process.env · Issue #2362 · webpack ...
This will NOT print anything. Run NODE_ENV=production && webpack --silent --mode=production && echo $NODE_ENV. This will print production.
Read more >
How can I set NODE ENV production on Windows - Edureka
At the command line: set NODE_ENV=production&&npm start. or set NODE_ENV=production&&node index. · The trick for it to work on Windows is you ...
Read more >
Do not use NODE_ENV for staging - Gleb Bahmutov
When running on staging or production, I set NODE_ENV variable on the server to staging or production . This value then lets my...
Read more >
What is Node_ENV Production and How to Get it on Windows ...
Set node_env =production & node whatever if you're using git bash on Windows. Js does not seem to function. Use the native cmd...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found