Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AlexWaha/dockdev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

πŸš€ DockDev β€” Instant Docker Dev Domains

⚑️ DockDev is a fast CLI tool that helps you create isolated Docker-based development environments with reverse proxy and custom local domains.

It lets you work locally in Windows + WSL with multiple projects β€” and access them in the browser using friendly domain names like https://app.test.

Docker Go WSL2 License


πŸ“¦ What is DockDev?

DockDev is a developer CLI utility written in Go that helps you instantly:

βœ… Features

  • πŸ”§ Spin up isolated Docker-based dev environments with NGINX, PHP, Node.js, Redis, ElasticMQ etc.
  • 🌐 All traffic is routed through a shared reverse proxy (nginx-reverse-proxy) for seamless local domain support
  • πŸ” Automatic SSL certificate generation with Windows trust store integration (HTTPS ready!)
  • πŸ›  Assign static IPs via a shared user-defined Docker network (bridge mode)
  • 🌍 Access each project via clean local domains like https://app.test
  • πŸ—‚ Automatically add the domain to your Windows hosts file
  • βš™οΈ Reverse proxy configs are generated per-project and hot-reloaded or restarted as needed
  • πŸ—ƒοΈ Includes a shared MySQL container for all projects β€” connect via native MySQL GUI clients on Windows
  • πŸ–₯️ Interactive CLI interface for creating and managing projects
  • πŸš€ Automatic Docker Desktop startup and container management

βœ… Ideal for full-stack development inside WSL2 + Docker Desktop environments.


πŸ“‹ Prerequisites

  • Windows with WSL2
  • Docker Desktop
  • Go 1.24+ (for building from source)

πŸ›  Installation & Build

Option 1: Build from Source πŸ”¨

  1. Clone the repository
  2. Run the build script:
./build.bat

The build script will:

  • Compile the Go code for Linux (WSL compatibility)
  • Create a distribution in the ../dist folder with the executable
  1. Manually copy the required files to your WSL user folder for example to /home/user/dockdev:

    • dist/dockdev (executable)
    • dist/templates/ (directory with all templates)
    • Create a .env configuration file (see Configuration section)
  2. Set proper executable permissions in your WSL environment:

chmod +x dockdev

Option 2: Use Pre-built Binary πŸ“¦

  1. Download the latest release from the releases page
  2. Extract the archive to your preferred location
  3. Run the executable from WSL2

βš™οΈ Setup

Required files and folders in your WSL environment:

  • .env (configuration file)
  • dockdev (executable)
  • templates/ (directory with templates)

πŸ’‘ Before you start!

If your index application folder is public or another, update nginx.conf

For example: root /var/www/html/public;

  1. You can update it before adding new project in templates/nginx.conf.tmpl for all projects

  2. or after, directly in domains/YOUR_DOMAIN/conf/nginx/default.conf

If #2 - Don't forget to remove and run project containers manually!


πŸš€ Usage

πŸ“˜ Available Commands

Command Description
./dockdev Start interactive mode
./dockdev domain.test Create a new project with the specified domain
./dockdev domain.test --no-ssl Create a project without SSL (not recommended)
./dockdev rm domain.test Delete an existing project
./dockdev -H or --help Show help message

πŸ’¬ Interactive Mode

Run the tool without arguments to enter interactive mode:

./dockdev

Interactive mode will:

  • Show existing projects
  • Allow you to create new projects
  • Allow you to delete existing projects
  • Guide you through all options with prompts

πŸ†• Create a New Project

./dockdev mydomain.test

πŸ”§ It will:

  • Create domains/mydomain.test/
  • Generate SSL certificates and add them to Windows trust store (HTTPS ready)
  • Assign next free IP like 172.20.0.12
  • Assign IP's for all project containers
  • Generate:
    • docker-compose.yml
    • conf/nginx/default.conf
    • app/index.html
    • reverse proxy config in shared-services/sites
  • Update:
    • .ipmap.env > This file just FYI
    • Windows hosts file
  • Automatically start all services
  • Open your browser to https://mydomain.test

Your application must be in app folder: domains/YOUR_DOMAIN/app

πŸ—‘οΈ Delete a Project

./dockdev rm mydomain.test

You'll be prompted:

Are you sure you want to delete domain 'mydomain.test'? [y/N]

Deletes:

  • Domain folder
  • Reverse proxy .conf
  • IP mapping entry
  • Hosts file entry
  • SSL certificates from disk and Windows trust store
  • Drop all domain containers

❓ Show Help

./dockdev --help

πŸ—οΈ Project Structure

Each project environment includes:

  • 🌐 Nginx web server
  • 🐘 PHP-FPM 8.3
  • πŸ“¦ Node.js 23
  • ⚑ Redis server
  • πŸ“¨ ElasticMQ (SQS-compatible message queue)
  • πŸ—ƒοΈ Shared MySQL database (across all projects)

πŸ” SSL Certificates

DockDev automatically:

  1. Generates a root CA certificate and adds it to Windows trust store
  2. Creates domain-specific SSL certificates for each project
  3. Configures Nginx to use HTTPS
  4. Makes all projects accessible via secure HTTPS connections

This means you can develop with:

  • HTTPS by default
  • No browser security warnings
  • Proper SSL testing in your local environment
  • Full compatibility with secure-only features

βš™οΈ Configuration

The tool uses an .env file for configuration:

NETWORK_NAME=local_net
SUBNET=10.0.100.0/24
REVERSE_PROXY_IP=10.0.100.2
SHARED_MYSQL_IP=10.0.100.3
PROJECT_START_IP=10.0.100.10
MYSQL_ROOT_PASSWORD=root
MYSQL_USER=user
MYSQL_PASSWORD=userpass

πŸ“ Directory Structure

β”œβ”€β”€ dockdev # Main executable
β”œβ”€β”€ templates/ # Project templates
β”‚ β”œβ”€β”€ app/ # Default web application files
β”‚ β”œβ”€β”€ conf/ # Configuration templates
β”‚ β”œβ”€β”€ image/ # Docker image definitions
β”‚ β”‚ β”œβ”€β”€ node/ # Node.js image
β”‚ β”‚ └── php/ # PHP image
β”‚ └── shared-services/ # Shared services templates
β”œβ”€β”€ domains/ # Generated project directories
└── shared-services/ # Shared services (MySQL, Nginx proxy)
 β”œβ”€β”€ certs/ # SSL certificates
 β”œβ”€β”€ sites/ # Nginx site configurations
 └── data/ # Persistent data

🧱 Architecture

  • πŸ”§ dockdev: CLI manager (Go)
  • πŸ“ templates/: reusable template files

You can extend docker-compose.yml.tmpl with your containers

  • 🌍 shared-services/: reverse proxy & shared MySQL DB
  • πŸ›  .ipmap.env

πŸ“˜ Reference file for developers, to track which containers was assigned to which IP

  • πŸ”Œ All containers in one shared Docker bridge network

βœ… Platform Compatibility

Platform Supported
βœ… Windows 10/11 + WSL βœ”οΈ Recommended

All routed via NGINX with shared IP space and automatic DNS mapping.


πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details.

About

🐳 CLI tool to create isolated Docker-based development environments with local domain access via NGINX reverse proxy. Designed for Windows + WSL2.

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /