burkeholland / burkeholland/express-react-starter
Best practices suggestions
- Dominant language
- JavaScript
- Stars
- 205
- Forks
- 84
- PR merge metrics
- No merged PRs in 30d
Description
Hey, I just read the article on medium. Thanks!
Based on the [best practices guide](https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md), 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](https://github.com/krallin/tini) into the `Dockerfile` itself. Relevant docs section - [Handling kernel signals](https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#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](https://github.com/nodejs/docker-node/blob/master/6.11/alpine/Dockerfile) 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](https://expressjs.com/en/advanced/best-practice-performance.html#set-nodeenv-to-production), among other things, recommends setting the `NODE_ENV` environment variable to `'production'`. This is mentioned in the [best practices guide](https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#environment-variables) 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect the repository's Dockerfile and current Docker entry point, then compare them with the linked Node official image and the referenced Best Practices sections. Clarify which suggestions are in scope, including tini, the Node version, non-root execution, and NODE_ENV; done means the agreed Dockerfile changes are implemented and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, express, javascript, node.js, react
- Domain
- backend, devops
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100