devstore
v1.0.0
Published
π Smart CLI to run, build and ship apps with Docker (local β remote β build)
Readme
π DevStore
A smart CLI to run, build, and ship apps with Docker β effortlessly.
DevStore simplifies Docker workflows by automatically handling image resolution, builds, and container execution with a clean developer experience.
β¨ Features
β‘ Smart Execution Pipeline
- Local β Remote β Build (automatic fallback)
π₯ Force Rebuild
- Rebuild images anytime using
--build
- Rebuild images anytime using
π¦ Optional Push
- Push images to Docker Hub with
--push
- Push images to Docker Hub with
π§ Auto Port Detection
- Avoid conflicts with automatic port switching
π§Ή Container Cleanup
- Removes old containers before running
π οΈ Project Initialization
- Generate Docker setup using
init docker
- Generate Docker setup using
π‘ Developer-Friendly CLI
- Clean logs and predictable behavior
π¦ Installation
Global install
npm install -g devstoreπ Quick Start (Recommended for Beginners)
# 1. Initialize Docker setup
devstore init docker
# 2. Run your app
devstore run my-appπ DevStore will:
- Create a Dockerfile
- Build your app
- Run it automatically
π Commands
πΉ Initialize project (Docker setup)
devstore init dockerCreates a production-ready Dockerfile based on your project.
πΉ Run an application
devstore run <image>Example:
devstore run my-appπΉ Run with custom port
devstore run my-app -p 4000:3000πΉ Force rebuild image
devstore run my-app --buildπΉ Build and push to Docker Hub
devstore run username/my-app --build --pushβ οΈ Make sure you're logged in:
docker loginπ§ Execution Flow
DevStore follows a smart execution strategy:
1. Check if image exists locally
2. If not β check remote registry (Docker Hub)
3. If not β build image from Dockerfile
4. Optionally push image
5. Run containerβοΈ Options
| Option | Description |
| ------------ | --------------------------------- |
| -p, --port | Port mapping (default: 3000:3000) |
| --build | Force rebuild image |
| --push | Push image to Docker Hub |
π§ͺ Example Output
βΉοΈ Using local image: my-app
βΉοΈ Cleaning old container: my-app
βΉοΈ Starting container...
β οΈ Port 3000 busy β switching to 3001
β
Running at http://localhost:3001 πβ Requirements
- Docker installed and running
- Node.js 18 or higher
π Project Structure
src/
βββ commands/ # CLI commands (init, run)
βββ service/docker/ # Docker logic (build, run, push)
βββ utils/ # logger, helpersβ οΈ Common Issues & Fixes
β Port already in use
Bind for 0.0.0.0:3000 failedβ DevStore auto-fixes this by switching ports.
β No Dockerfile found
failed to read dockerfileβ Run:
devstore init dockerβ Push failed
docker push errorβ Fix:
docker loginπ Notes
- A
Dockerfileis required for building images - DevStore can generate one using
init docker - Image push requires proper naming (
username/image)
π οΈ Roadmap
- [ ]
devstore logs(view container logs) - [ ]
devstore stop(stop running container) - [ ] Auto-detect frameworks (Next.js, Express)
- [ ] Deployment support
π€ Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch
- Submit a pull request
π¨βπ» Author
Monu Panwar
π License
MIT License
β Support
If you find this project useful, consider giving it a β on GitHub!
