Skip to content

driverfox128/docker-wp-generator-multi-instance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

docker-wp-generator-multi-instance

Automated local WordPress environment spawner. Create, configure, and run multiple isolated instances simultaneously with dedicated databases and custom host ports.

Docker WP Generator (Multi-Instance)

A lightweight, automated Bash script to instantly spawn multiple, fully-isolated WordPress environments running concurrently using Docker Compose.

Each generated site runs on its own isolated network pair (WordPress container + dedicated MariaDB instance), utilizing customized container names and dedicated host ports to prevent any infrastructure conflicts.

🚀 Key Features

  • True Concurrency: Deploy and run multiple local sites simultaneously without naming or port collisions.
  • On-Demand Directory Spawning: Choose exactly where your project folders are generated (supports absolute paths and ~ expansion).
  • Automatic Target Bootstrapping: If the target parent directory doesn't exist, the script creates it dynamically.
  • Environment Isolation: Credentials are locked down safely inside local .env files—no hardcoded plain text in your orchestration templates.
  • Optimized Configurations: Generates a custom uploads.ini out-of-the-box (512M memory, execution limits) tailored for heavy page builders like Elementor.
  • Clean Terminal Feedback: Built-in dynamic logging delays to ensure readability during execution.

🛠️ Prerequisites

Ensure you have the following installed on your machine (optimized for Arch Linux / Fish Shell setups):

fish

Verify core dependencies

docker --version docker compose version

📦 Installation & Setup

1- Clone or copy the setup-generate.sh script to your local system utilities directory.

2- Make the script executable: chmod +x setup-generate.sh

3- Run the generator: ./setup-generate.sh

📖 How It Works

When executed, the script will guide you through a stream of minimal inputs:

Target Directory: Define the parent path (e.g., ~/Projects/WordPress).

Site Name: Used to clean-sanitize folder names, container names (sitename_wordpress / sitename_db), and database schemas.

Local Port: Assign a unique port (e.g., 8081, 8082) to route traffic to that specific instance.

Database Credentials: Isolated user/password combinations written straight to .env.

🎮 Useful Lifecycle Commands

Once your environment structure is generated, navigate into the created project folder to manage your stack:

Spin up the containers in detached mode

docker compose up -d

Check live status of your containers

docker ps

Stop the site without losing data (Recommended Daily Use)

docker compose stop

Resume execution of your stopped site (Recommended Daily Use)

docker compose start

Bring down the containers entirely

docker compose down

Destroy the stack along with its local database volume (Destructive)

docker compose down -v

⚠️ Crucial Rule: Port Management

Pro Tip for Concurrency: Since the main objective of this generator is to run multiple, fully-isolated WordPress sites at the same time, respecting port allocation is a rule that must be followed strictly.

To prevent network collisions on your host system, always assign a unique, unused local port to each new site instance during the setup prompts.

For example:

  • site1 ➡️ http://localhost:8081
  • site2 ➡️ http://localhost:8082
  • site3 ➡️ http://localhost:8083

About

Automated local WordPress environment spawner with Docker/Docker Compose. Create, configure, and run multiple isolated instances simultaneously with dedicated databases and custom host ports.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages