Skip to content

Commit 2b6c43c

Browse files
committed
Merge branch 'master' into docker_section
2 parents 2dddd7a + dc060fc commit 2b6c43c

File tree

5 files changed

+54
-11
lines changed

5 files changed

+54
-11
lines changed

.all-contributorsrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,33 @@
933933
"contributions": [
934934
"content"
935935
]
936+
},
937+
{
938+
"login": "byeze",
939+
"name": "Ezequiel",
940+
"avatar_url": "https://avatars1.githubusercontent.com/u/7424138?v=4",
941+
"profile": "https://github.com/byeze",
942+
"contributions": [
943+
"translation"
944+
]
945+
},
946+
{
947+
"login": "juaoose",
948+
"name": "Juan José Rodríguez",
949+
"avatar_url": "https://avatars3.githubusercontent.com/u/994594?v=4",
950+
"profile": "https://github.com/juaoose",
951+
"contributions": [
952+
"translation"
953+
]
954+
},
955+
{
956+
"login": "OrBin",
957+
"name": "Or Bin",
958+
"avatar_url": "https://avatars1.githubusercontent.com/u/6897234?v=4",
959+
"profile": "https://github.com/OrBin",
960+
"contributions": [
961+
"content"
962+
]
936963
}
937964
],
938965
"projectName": "nodebestpractices",

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function someFunction() {
259259
}
260260

261261
// Avoid
262-
function someFunction()
262+
function someFunction()
263263
{
264264
// code block
265265
}
@@ -995,7 +995,7 @@ All statements above will return false if used with `===`
995995

996996
**TL;DR:** Any step in the development chain should be protected with MFA (multi-factor authentication), npm/Yarn are a sweet opportunity for attackers who can get their hands on some developer's password. Using developer credentials, attackers can inject malicious code into libraries that are widely installed across projects and services. Maybe even across the web if published in public. Enabling 2-factor-authentication in npm leaves almost zero chances for attackers to alter your package code.
997997

998-
**Otherwise:** [Have you heard about the eslint developer who's password was hijacked?](https://medium.com/@oprearocks/eslint-backdoor-what-it-is-and-how-to-fix-the-issue-221f58f1a8c8)
998+
**Otherwise:** [Have you heard about the eslint developer whose password was hijacked?](https://medium.com/@oprearocks/eslint-backdoor-what-it-is-and-how-to-fix-the-issue-221f58f1a8c8)
999999

10001000
<br/><br/>
10011001

@@ -1105,7 +1105,7 @@ Bear in mind that with the introduction of the new V8 engine alongside the new E
11051105

11061106
**TL;DR:** When using a Docker run time orchestrator (e.g., Kubernetes), invoke the Node.js process directly without intermediate process managers or custom code that replicate the process (e.g. PM2, Cluster module). The runtime platform has the highest amount of data and visibility for making placement decision - It knows best how many processes are needed, how to spread them and what to do in case of crashes
11071107

1108-
**Otherwise:** Container keeps crashing due to lack of resources will get restarted indefinitely by the process manager. Should Kubernetes be aware of that, it could relocate it to a different roomy instance
1108+
**Otherwise:** Container keeps crashing due to lack of resources will get restarted indefinitely by the process manager. Should Kubernetes be aware of that, it could relocate it to a different roomy instance
11091109

11101110
🔗 [**Read More: Let the Docker orchestrator restart and replicate processes**](/sections/docker/restart-and-replicate-processes.md)
11111111

@@ -1133,7 +1133,7 @@ Bear in mind that with the introduction of the new V8 engine alongside the new E
11331133

11341134
<br /><br /><br />
11351135

1136-
## ![] 8.6. Shutdown smartly and gracefully
1136+
## ![] 8.6. Shutdown smartly and gracefully
11371137

11381138
**TL;DR:** Handle the process SIGTERM event and clean-up all existing connection and resources. This should be done while responding to ongoing requests. In Dockerized runtimes shutting down containers is not a rare event, rather a frequent occurrence that happen as part of routine work. Achieving this demands some thoughtful code to orchestrate several moving parts: The load balancer, keep-alive connections, the HTTP server and other resources
11391139

@@ -1296,14 +1296,25 @@ Full Stack Developer & Site Reliability Engineer based in New Zealand, intereste
12961296

12971297
<br/>
12981298

1299+
<img align="left" width="100" height="100" src="assets/images/members/kevyn.png">
1300+
1301+
[Kevyn Bruyere](https://github.com/kevynb)
1302+
<a href="https://www.linkedin.com/in/kevynbruyere/"><img src="assets/images/linkedin.png" width="16" height="16"></img></a>
1303+
1304+
Independent full-stack developer with a taste for Ops and automation.
1305+
1306+
<br/>
1307+
1308+
### Steering Committee Emeriti
1309+
12991310
<img align="left" width="100" height="100" src="assets/images/members/sagir.png">
13001311

13011312
[Sagir Khan](https://github.com/sagirk)
13021313
<a href="https://twitter.com/sagir_k"><img src="assets/images/twitter-s.png" width="16" height="16"></img></a>
1303-
<a href="https://sagirk.com"><img src="assets/images/www.png" width="16" height="16"></img></a>
13041314
<a href="https://linkedin.com/in/sagirk"><img src="assets/images/linkedin.png" width="16" height="16"></img></a>
1315+
<a href="https://sagirk.com"><img src="assets/images/www.png" width="16" height="16"></img></a>
13051316

1306-
Deep specialist in JavaScript and its ecosystem — React, Node.js, MongoDB, pretty much anything that involves using JavaScript/JSON in any layer of the system — building products using the web platform for the world’s most recognized brands. Individual Member of the Node.js Foundation, collaborating on the Community Committee's Website Redesign Initiative.
1317+
Deep specialist in JavaScript and its ecosystem — React, Node.js, TypeScript, GraphQL, MongoDB, pretty much anything that involves JS/JSON in any layer of the system — building products using the web platform for the world’s most recognized brands. Individual Member of the Node.js Foundation.
13071318

13081319
<br/>
13091320

@@ -1313,11 +1324,11 @@ Thank you to all our collaborators! 🙏
13131324

13141325
Our collaborators are members who are contributing to the repository on a regular basis, through suggesting new best practices, triaging issues, reviewing pull requests and more. If you are interested in helping us guide thousands of people to craft better Node.js applications, please read our [contributor guidelines](/.operations/CONTRIBUTING.md) 🎉
13151326

1316-
| <a href="https://github.com/idori" target="_blank"><img src="assets/images/members/ido.png" width="75" height="75"></a> | <a href="https://github.com/TheHollidayInn" target="_blank"><img src="assets/images/members/keith.png" width="75" height="75"></a> | <a href="https://github.com/kevynb" target="_blank"><img src="assets/images/members/kevyn.png" width="59" height="59"></a> |
1317-
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: |
1318-
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) | [Kevyn Bruyere](https://github.com/kevynb) |
1327+
| <a href="https://github.com/idori" target="_blank"><img src="assets/images/members/ido.png" width="75" height="75"></a> | <a href="https://github.com/TheHollidayInn" target="_blank"><img src="assets/images/members/keith.png" width="75" height="75"></a> |
1328+
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
1329+
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
13191330

1320-
### Past collaborators
1331+
### Collaborator Emeriti
13211332

13221333
| <a href="https://github.com/refack" target="_blank"><img src="assets/images/members/refael.png" width="50" height="50"></a> |
13231334
| :-------------------------------------------------------------------------------------------------------------------------: |
@@ -1468,6 +1479,11 @@ Thanks goes to these wonderful people who have contributed to this repository!
14681479
<td align="center"><a href="https://github.com/nDmitry"><img src="https://avatars0.githubusercontent.com/u/2134568?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Nikitenko</b></sub></a><br /><a href="#content-nDmitry" title="Content">🖋</a></td>
14691480
<td align="center"><a href="https://bushuai.cc"><img src="https://avatars0.githubusercontent.com/u/1875256?v=4" width="100px;" alt=""/><br /><sub><b>bushuai</b></sub></a><br /><a href="https://github.com/goldbergyoni/nodebestpractices/pulls?q=is%3Apr+reviewed-by%3Abushuai" title="Reviewed Pull Requests">👀</a> <a href="#content-bushuai" title="Content">🖋</a></td>
14701481
<td align="center"><a href="https://stackoverflow.com/users/1348195/benjamin-gruenbaum"><img src="https://avatars2.githubusercontent.com/u/1315533?v=4" width="100px;" alt=""/><br /><sub><b>Benjamin Gruenbaum</b></sub></a><br /><a href="#content-benjamingr" title="Content">🖋</a></td>
1482+
<td align="center"><a href="https://github.com/byeze"><img src="https://avatars1.githubusercontent.com/u/7424138?v=4" width="100px;" alt=""/><br /><sub><b>Ezequiel</b></sub></a><br /><a href="#translation-byeze" title="Translation">🌍</a></td>
1483+
<td align="center"><a href="https://github.com/juaoose"><img src="https://avatars3.githubusercontent.com/u/994594?v=4" width="100px;" alt=""/><br /><sub><b>Juan José Rodríguez</b></sub></a><br /><a href="#translation-juaoose" title="Translation">🌍</a></td>
1484+
</tr>
1485+
<tr>
1486+
<td align="center"><a href="https://github.com/OrBin"><img src="https://avatars1.githubusercontent.com/u/6897234?v=4" width="100px;" alt=""/><br /><sub><b>Or Bin</b></sub></a><br /><a href="#content-OrBin" title="Content">🖋</a></td>
14711487
</tr>
14721488
</table>
14731489

assets/images/anchore-report.png

122 KB
Loading

assets/images/members/kevyn.png

-870 KB
Loading

sections/docker/docker-ignore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### One Paragraph Explainer
66

7-
The Docker build command copies the local files into the build context environment over a virtual network. Be careful - development and CI folders contain secrets like .npmrc, .aws, .env files, and other sensitive files. Consequently, Docker images might hold secrets and expose them in unsafe territories (e.g. Docker repository, partners servers). In a better world the Dockerfile should be explicit about what is being copied. On top of this include a .dockerignore file that acts as the last safety net that filters out unnecessary folders and potential secrets. Doing so also boosts the build speed - By leaving out common development folders that have no use in production (e.g. .git, test results, IDE configuration), the builder can better utilize the cache and achieve better performance
7+
The Docker build command copies the local files into the build context environment over a virtual network. Be careful - development and CI folders contain secrets like .npmrc, .aws, .env files and other sensitive files. Consequently, Docker images might hold secrets and expose them in unsafe territories (e.g. Docker repository, partners servers). In a better world the Dockerfile should be explicit about what is being copied. On top of this include a .dockerignore file that acts as the last safety net that filters out unnecessary folders and potential secrets. Doing so also boosts the build speed - By leaving out common development folders that have no use in production (e.g. .git, test results, IDE configuration), the builder can better utilize the cache and achieve better performance
88

99
<br/><br/>
1010

0 commit comments

Comments
 (0)