mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-29 00:19:14 +08:00
Sorting the bullets
This commit is contained in:
@ -1083,7 +1083,7 @@ Bear in mind that with the introduction of the new V8 engine alongside the new E
|
||||
|
||||
## ![✔] 8.1 Use multi-stage builds for leaner and more secure Docker images
|
||||
|
||||
**TL;DR:** A lot of build-time dependencies and files are not needed for running your application. With multi-stage builds, these resources can be used during build, while the runtime environment contains only what's necessary. Multi-stage builds are an easy way to reduce overhead in size and vulnerabilities.
|
||||
**TL;DR:** Use multi-stage build to copy only necessary production artifacts. A lot of build-time dependencies and files are not needed for running your application. With multi-stage builds, these resources can be used during build, while the runtime environment contains only what's necessary. Multi-stage builds are an easy way to get rid of overweight and security threats
|
||||
|
||||
**Otherwise:** Larger images will take longer to build and ship, build-only tools might contain vulnerabilities, and secrets only meant for the build phase might be leaked.
|
||||
|
||||
|
||||
@ -8,35 +8,8 @@ In a Dockerized runtime like Kubernetes, containers are born and die frequently.
|
||||
|
||||
<br/><br/>
|
||||
|
||||
### Code Example – A graceful shutdown when using Express and Kubernetes
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>JavaScript</strong></summary>
|
||||
|
||||
```
|
||||
TBD
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
### Code Example – Harsh shutdown
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>JavaScript</strong></summary>
|
||||
|
||||
```
|
||||
TBD
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
### Code Example – Making Node.js the root process allowing passing signals to the code
|
||||
### Code Example – Placing Node.js as the root process allows passing signals to the code
|
||||
|
||||
<details>
|
||||
|
||||
@ -109,7 +82,3 @@ CMD ["npm", "start"]
|
||||
From the blog, [Rising Stack](https://blog.risingstack.com/graceful-shutdown-node-js-kubernetes/)
|
||||
|
||||

|
||||
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user