Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices suggestions #3

Open
sudo-suhas opened this issue Aug 26, 2017 · 1 comment
Open

Best practices suggestions #3

sudo-suhas opened this issue Aug 26, 2017 · 1 comment

Comments

@sudo-suhas
Copy link

Hey, I just read the article on medium. Thanks!

Based on the best practices guide, I have a few suggestions:

  • I am not sure if azure has a way to pass flags to the docker command. So it would be better to integrate the lightweight init system tini into the Dockerfile itself. Relevant docs section - Handling kernel signals
  • The base image used is mhart/alpine-node which does not immediately convey the exact node version being used. Additionally, why not use node official image? There's one for alpine as well.
  • By default, docker is run with a privileged root user. This isn't recommended as it is a security concern. The official node docker images provide a non-root user that you can use to run the actual process.
  • The express recommendations for performance, among other things, recommends setting the NODE_ENV environment variable to 'production'. This is mentioned in the best practices guide as well.

I am by no means an expert on the subject but I collated some notes while I was trying to setup Docker for something at my workplace. Maybe you will find it useful - https://github.com/sudo-suhas/docker_notes/blob/master/11-docker-for-node-js.md#dockerfile.

@burkeholland
Copy link
Owner

These are great suggestions! I'll try and work these in soon. Feel free to submit a PR if you would like to see them in sooner. 😊

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

No branches or pull requests

2 participants