A Docker orchestration CLI tool for managing multiple Next.js and WordPress projects with automatic routing and zero configuration.
Inspired by devner.
- π One-command project creation -
dockerator new nextjs|wp|vite <name> - π TypeScript by default - New Next.js projects scaffold as TypeScript (strict mode), not JavaScript
- ποΈ Shared services - MySQL, Adminer, Mailpit across all projects
- π Opt-in DB wiring -
--with-dbflag connects Next.js projects to MySQL on demand - π Hot reload - Changes reflect immediately (Vite + Next.js)
- π Clean URLs -
project-name.localhostfor each project - π Auto /etc/hosts sync - No manual editing
- π Project management - List, open, and manage all projects
- β‘ Shell autocomplete - Tab completion for commands and projects
- π¨ VS Code integration - Open projects directly from CLI
- Docker Desktop installed and running (Download)
- macOS or Linux
- Basic terminal knowledge
- Node.js & npm installed (for Vite project scaffolding) (Download)
# Verify Docker is running
docker --version# 1. Clone and install
git clone https://github.com/elenagoto/dockerator.git
cd dockerator
bash install.sh
# 2. Start base services
dockerator up
# 3. Sync hosts file
dockerator hosts- ποΈ Traefik Dashboard: http://localhost:8080
- ποΈ Adminer (Database): http://dockerator-adminer.localhost
- Server:
mysql| User:root| Pass:dockerator
- Server:
- π§ Mailpit (Email Testing): http://dockerator-mailpit.localhost
dockerator new nextjs my-app
dockerator hosts
dockerator start my-app
# Visit: http://my-app.localhostScaffolds a TypeScript Next.js app (strict mode) β src/app/page.tsx, src/app/layout.tsx, and a tsconfig.json at the project root. Run npm run type-check inside dev mode any time to check types without a full build.
With MySQL connected:
dockerator new nextjs my-app --with-db
dockerator hosts
dockerator start my-app
# Visit: http://my-app.localhostThis wires the container to the shared MySQL service with:
DB_HOST=mysqlDB_NAME=my_app(underscores)DB_USER=my_appDB_PASSWORD=my_app- Waits for MySQL to be healthy before starting (
depends_on)
Without the flag, the project starts with no database connection β useful for pure frontend practice.
Using an existing/downloaded project instead of scaffolding a new one? See Bringing In Existing Projects below β the TypeScript default does not get forced onto projects that already have their own
src/app(e.g. course exercises).
dockerator new wp my-site
dockerator hosts
dockerator start my-site
# Visit: http://my-site.localhostdockerator new vite my-vite
dockerator hosts
dockerator start my-vite
# Visit: http://my-vite.localhostIf you download a project (e.g. a course repo) into apps/<name> and then run dockerator new nextjs <name> to wire up Docker, Dockerator only fills in what's missing β it never overwrites or restructures files that already exist:
- Already has
package.json? Left untouched, as-is (whatever dependencies/JS-or-TS setup it already has). - Already has
src/app? The entire scaffolding step (including the defaulttsconfig.json) is skipped β the project stays exactly as downloaded, TypeScript or not. - Missing
Dockerfile/.dockerignore? Those get added, since Docker plumbing is Dockerator's actual job.
In short: the TypeScript default only applies to brand-new projects scaffolded from scratch. A downloaded plain-JS course project run through dockerator new nextjs stays plain JS β nothing forces a conversion.
# Enter dev mode (exposes port 5173 for Vite HMR)
dockerator dev-wp my-site
# Inside container:
π¦ Installing new packages:
1. pkill -f 'next dev' - Stop dev server
2. npm install <package> - Install package
3. npm run dev - Restart dev server
π§ Other commands:
npm run build - Build for production
npm run lint - Lint code
# When done: exitYour theme location: apps/my-site/wp-content/themes/my-site/
# Enter dev mode
dockerator dev-nextjs my-app
# or
dockerator dev-vite my-app
# or
dockerator dev-front my-app
# Inside container:
π¦ Installing new packages:
1. pkill -f 'next dev' - Stop dev server
2. npm install <package> - Install package
3. npm run dev - Restart dev server
π§ Other commands:
npm run build - Build for production
npm run lint - Lint code
npm run type-check - Check TypeScript types without building (TS projects only)
# When done: exitdockerator list # List all projects with status
dockerator open <name> # Open project in VS Code
dockerator start <name> # Start project
dockerator stop <name> # Stop project
dockerator restart <name> # Restart with a full dependency reinstall (node_modules included)
dockerator logs <name> # View logs
dockerator remove <name> # Remove project completely
dockerator hosts # Sync /etc/hostsdockerator/
βββ dockerator # Main CLI script
βββ install.sh # Installation script
βββ docker-compose.yml # Active config (git-ignored)
βββ docker-compose.yml.example # Template
βββ dockerator-completion.bash # Bash autocomplete
βββ dockerator-completion.zsh # Zsh autocomplete
βββ scripts/
β βββ templates/ # Project templates
β β βββ nextjs/
β β β βββ .dockerignore
β β β βββ .gitkeep
β β β βββ Dockerfile
β β β βββ tsconfig.json
β β β βββ page.tsx
β β β βββ layout.tsx
β β βββ vite/
β β β βββ .dockerignore
β β β βββ Dockerfile
β β βββ wordpress/
β β βββ .gitkeep
β β βββ Caddyfile
β β βββ Dockerfile
β β βββ wp-config.php.template
β βββ add-to-compose-nextjs.sh # Add NextJS project to compose
β βββ add-to-compose-vite.sh # Add Vite project to compose
β βββ add-to-compose-wp.sh # Add WordPress to compose
β βββ dev-mode-frontend.sh # Enter Next.js/Vite dev mode
β βββ dev-mode-wp.sh # Enter WordPress dev mode
β βββ list-projects.sh # List all projects
β βββ new-nextjs.sh # Create Next.js project
β βββ new-vite-react.sh # Create Vite React project
β βββ new-wordpress.sh # Create WordPress project
β βββ open-project.sh # Open project in VS Code
β βββ remove-from-compose.sh # Remove project from compose
β βββ remove-project.sh # Delete project completely
β βββ restart-project.sh # Restart a project, reinstalling dependencies
β βββ start-project.sh # Start a project
β βββ stop-project.sh # Stop a project
β βββ sync-hosts.sh # Sync /etc/hosts file
βββ apps/ # Your projects (git-ignored)
Each WordPress site automatically gets:
- Database:
project_name(underscores) - User:
project_name - Password:
project_name - Host:
mysql
Database wiring is opt-in via the --with-db flag (see Usage above) β not automatic like WordPress. Same naming convention applies:
- Database:
project_name(underscores) - User:
project_name - Password:
project_name - Host:
mysql
Access all databases via Adminer: http://dockerator-adminer.localhost
# Check what's using port 80
lsof -i :80
# Stop other Docker projects
docker-compose down# 1. Is container running?
docker-compose ps
# 2. Sync hosts file
dockerator hosts
# 3. Check Traefik dashboard
open http://localhost:8080# Wait ~30 seconds for MySQL to be healthy
docker-compose ps
# Check MySQL logs
dockerator logs mysqlIf a Next.js project was created before the --with-db flag existed, it won't have DB_* environment variables or a MySQL dependency β that's expected, not a bug. Two options:
- Remove the project and recreate it with
dockerator new nextjs <name> --with-db - Manually add the
environmentanddepends_onblocks to that project's service entry indocker-compose.yml(see the Next.js block indocker-compose.yml.exampleas a reference for the shape)
Two possible reasons, both expected:
- Created before TypeScript became the default β same situation as the DB flag above. Recreate it, or manually add
tsconfig.json+ convert files yourself. - Scaffolded from an existing/downloaded project (e.g. a course repo) that already had its own
src/appβ Dockerator intentionally does not force TypeScript onto projects it didn't create from scratch. See Bringing In Existing Projects.
# Docker creates files as root, use Docker to remove them
docker run --rm -v "$(pwd)":/data alpine rm -rf /data/apps/project-name- First WP project: ~2-3 minutes (installs PHP extensions + Node.js)
- Second WP project: ~1 minute (uses Docker cache)
- Reopening existing: Instant! β‘
dockerator new nextjs my-app
dockerator hosts # β Don't forget this!# Wrong:
nano docker-compose.yml # β Changes will be lost
# Right:
nano docker-compose.yml.example # β
Edit the template
cp docker-compose.yml.example docker-compose.ymlWait ~30 seconds after dockerator up before accessing WordPress sites.
Contributions welcome! Fork, create a feature branch, and open a PR.
- Laravel support
- GUI dashboard (web-based)
- Backup/restore functionality
- Windows support (WSL2)
- PostgreSQL support
MIT - see LICENSE file
- π Bug reports: Open an issue
- π‘ Feature requests: Open an issue
- devner by MarJC5 - The inspiration
- Traefik - Dynamic reverse proxy
- FrankenPHP - Modern PHP application server
Made with β€οΈ for efficient local development
If this project helped you, give it a βοΈ!