Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antoine-coulon/running-containerized-apps
A short guide to safely run and manage containerized applications the right way
https://github.com/antoine-coulon/running-containerized-apps
Last synced: 14 days ago
JSON representation
A short guide to safely run and manage containerized applications the right way
- Host: GitHub
- URL: https://github.com/antoine-coulon/running-containerized-apps
- Owner: antoine-coulon
- License: mit
- Created: 2023-11-06T14:42:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-06T17:33:32.000Z (about 1 year ago)
- Last Synced: 2024-10-09T10:06:25.837Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Running containerized applications
**Please start by reading [BEST-PRACTICES.md](./BEST-PRACTICES.md) which summarizes some of the core principles to respect when running containerized applications.**
## Node.js
All the current examples are using [Node.js](https://github.com/nodejs) but keep in mind that they are valid for most platforms running code.
If anyone is interested in providing other examples for the JVM, Python, Go, Rust... Feel free to submit PRs :)
To follow the article with examples, you can use the three provided Dockerfile.
- `Docker` needs to be up and running on the host machine.
- Use `./nodejs/docker-build.sh` to build the three images: `node-shell-form`, `node-exec-form`, `node-with-tini`.
- Then just `docker run `.
### `node-shell-form`
1. `docker run node-shell-form`
2. Then access the container `docker exec -it node-shell-form /bin/sh`
3. In the container shell, run `ps aux`
4. Observe `/bin/sh` being PID1
5. Run `docker stop `
6. Observe the Node.js script not receiving the SIGTERM signal hence keeping running until Docker sends SIGKILL after 10 seconds.### `node-exec-form`
1. `docker run node-exec-form`
2. Then access the container `docker exec -it /bin/sh`
3. In the container shell, run `ps aux`
4. Observe `Node.js` being PID1
5. Run `docker stop `
6. Observe the Node.js script receiving the SIGTERM signal hence allowing the graceful shutdown### `node-with-tini`
1. `docker run node-with-tini`
2. Then access the container `docker exec -it /bin/sh`
3. In the container shell, run `ps aux`
4. Observe `Tini` being PID1
5. Run `docker stop `
6. Observe Tini receiving the SIGTERM signal and forwarding it to Node.js hence allowing the graceful shutdown