Rules of 12-factor-apps
- You ship it - you run it
- Monitoring is the new Testing
- Don't repair - rebuild
- Automate work processes
- Test/Stage/Prod is always the same - create different versions
- Be immutable - create different versions
- Prefer a stateless (programming) model
- Support SIGTERM for graceful shutdowns
- Configuration via Environment-Vars
- Scaling, Logging, Tracing isn't your business
- Create and run small (Micro)services
- Prefer Async I/O (Communication, Data-Access, etc.)
- Prefer Stateless or use Data-Replication
- Use Environment-Variables to configure application parameters
- Using SIGTEM for graceful shutdowns
- Using StdOut/StdErr to log output
- Prefer using a Service-Discovery
npm i dockerode --save
const Dockerode = require('dockerode');
const localDocker = new Dockerode('unix://var/run/docker.sock');
docker build -t docker-monitor .
docker run -v /var/run/docker.sock:/var/run/docker.sock --privileged docker-monitor