Skip to content
This repository has been archived by the owner on Mar 7, 2020. It is now read-only.

Setting NODE_ENV to production by default #11

Open
Templum opened this issue Oct 22, 2018 · 4 comments
Open

Setting NODE_ENV to production by default #11

Templum opened this issue Oct 22, 2018 · 4 comments

Comments

@Templum
Copy link

Templum commented Oct 22, 2018

Currently, we already configure the log level of NPM and further only install production (runtime) dependency.
I suggest the default setting of NODE_ENV to production as this will increase the overall performance of the express server, without any additional effort.

@alexellis
Copy link
Member

I'm generally for this. Would it benefit the normal node template too? What are the side effects for people relying on this for debugging and how does it impact them?

@Templum
Copy link
Author

Templum commented Oct 22, 2018

Regarding the benefit to the normal node template:
The thing is, at least for express it will make an impact. Usually, the application needs to make use of the parameter, for example, to reduce unnecessary logging or unnecessary logic. Overall it might, but it is not guaranteed. However, it should not negatively impact it.

Regarding the side effects:
I'm not aware of side effects, it might reduce the overall logging verbosity, however, if it is clearly stated you can override it on demand in the stack.yml. And I believe it is more likely that you will end up forgetting to set it to production. So if someone is actively developing, he can make use of the overriding.

@telackey
Copy link
Contributor

telackey commented Oct 22, 2018

I like the idea of it as a default, so long as it could be overridden. For example, we could set NODE_ENV=production in the Dockerfile, but override it with -e on the CLI, stack.yml, docker-compose.yml, etc.

@padiazg
Copy link

padiazg commented Oct 22, 2018

I like this proposal, also for the regular template. As I debug, it wont have any side effect, besides it can be overriden.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants