cli-docker-runner
v2.1.3
Published
Secure CLI tool to run frontend projects in Docker containers, protecting local environment from malicious packages
Maintainers
Readme
CLI Docker Runner
A secure CLI tool for running frontend projects in Docker containers to protect your local environment from potentially malicious packages.
Quick Start
# Install globally
npm install -g cli-docker-runner
# Or use with npx
npx cli-docker-runner runSecurity & Quality
This project is continuously monitored for security vulnerabilities and maintains high code quality standards:
- 🛡️ Snyk Security: Automated vulnerability scanning
- 🔍 GitHub Security: Code scanning with SARIF reports
- ✅ Continuous Testing: Multi-version Node.js testing (16.x, 18.x, 20.x)
- 📊 Code Coverage: Tracked with Codecov integration
Features
- 🛡️ Security: Isolate projects from your local environment
- 🚀 Easy to use: Interactive CLI interface
- 🐳 Docker-based: Full isolation with Docker containers
- ⚙️ Flexible: Choose Node.js version, manage env vars
- 📦 Smart: Auto-detects scripts from package.json
- ♻️ Efficient: Reuses existing containers on subsequent runs
Supported Frameworks
CLI Docker Runner automatically detects and optimizes for modern web frameworks:
- ⚡ Vite - Hot Module Replacement (HMR) with
--host 0.0.0.0configuration - ⚛️ React - Create React App and Vite-based React projects
- 💚 Vue - Vue CLI and Vite-based Vue projects
- 🚀 Astro - Native dev server with automatic host configuration
- 🟢 Node.js - Traditional Node.js applications with nodemon
Framework Intelligence:
- Automatically skips nodemon installation for frameworks with built-in HMR
- Configures dev servers for network accessibility in Docker containers
- Installs platform-specific Rollup packages for optimized builds
Commands
# Run project in Docker (reuses existing container if available)
docker-runner run [options]
# Install dependencies
docker-runner install
# Update dependencies
docker-runner update
# Clean up Docker containers and images
docker-runner clean [options]Options
Run command
-n, --node <version>- Node.js version (default: 22)-p, --port <port>- Port to expose (default: 3000)--no-cache- Build without cache
Clean command
-f, --force- Force removal without confirmation
How it works
- First run: Creates a new Docker container with all dependencies (including dev)
- Subsequent runs: Automatically reuses the existing container for faster startup
- Clean: Remove all containers and images when you're done
License
MIT
