GitHub - Centralize/dockerScripts: Scripts to easily get containers up and running.
A comprehensive collection of bash scripts for quickly deploying and managing Docker containers for various applications and services.
Overview
This repository provides automated setup scripts for common web applications, databases, development tools, and system services using Docker. Each script handles container creation, network configuration, and service-specific setup requirements.
Features
- Automated Container Deployment: One-command setup for popular applications
- Network Management: Automatic network creation and configuration
- Security: Password generation and secure container networking
- Backup & Restore: Container backup and restoration utilities
- Interactive Menus: User-friendly script selection interfaces
- Lifecycle Management: Start, stop, and cleanup operations
Supported Applications
Web Applications
- WordPress: Full WordPress setup with MySQL backend
- Drupal: Drupal CMS deployment
- Ghost Blog: Ghost blogging platform
- OpenCart: E-commerce platform
- Magento: Advanced e-commerce solution
Databases
- MySQL: MySQL server with configurable ports
- MariaDB: MariaDB database server
Development Tools
- Portainer: Docker management interface
- Portainer CE: Community edition
- Portainer Agent: Remote management agent
- Prometheus: Monitoring and alerting system
System Services
- PiHole: Network-wide ad blocking
- Nginx Proxy: Reverse proxy for container services
- Redmine: Project management tool
Gaming
- Minecraft: Minecraft server
- Cuberite: Lightweight Minecraft server alternative
Quick Start
Interactive Menu
Dialog-based Menu
Script Categories
Setup Scripts
All setup scripts follow the naming convention setup<Application>.sh:
setupWordpress.sh <domain> <customerName>- WordPress with MySQLsetupMysql.sh <password>- Standalone MySQL serversetupPortainer.sh- Portainer management interfacesetupPiHole.sh- Pi-hole ad blockersetupRedmineSQLite3.sh <domain>- Redmine with SQLite
Management Scripts
cleanNetwork.sh <customerName>- Remove customer networksremoveContainer.sh <containerName>- Stop and remove containerscleanUp.sh <domain>- Clean up by domainstartAllContainers.sh <containerFile>- Bulk container startup
Utility Scripts
console.sh <containerID> <command>- Execute commands in containerscreateDB.sh <user> <database>- Create MySQL databaseslistDomains.sh- List active domainssetupHosts.sh <hostname>- Add entries to /etc/hosts
Backup & Restore
backupAll.sh <containerFile>- Backup multiple containersdockerBackup.sh <container>- Backup single containerdockerRestore.sh <container>- Restore container from backup
Usage Examples
WordPress Deployment
./setupWordpress.sh example.com customer1
Creates:
- Customer-specific Docker network
- MySQL container with generated password
- WordPress container linked to MySQL
- Domain configuration for reverse proxy
Database Setup
./setupMysql.sh mySecurePassword
Container Management
./removeContainer.sh customer1-wordpress ./cleanNetwork.sh customer1
Backup Operations
./dockerBackup.sh customer1-wordpress ./backupAll.sh container_list.txt
Network Architecture
Scripts automatically create isolated networks for multi-container applications:
- Customer-specific networks (e.g.,
customer1-wordpress-net) - Secure inter-container communication
- External access via reverse proxy
Security Features
- Generated Passwords: Automatic secure password generation
- Network Isolation: Containers run in isolated networks
- Access Control: Domain-based access restrictions
- No Hardcoded Credentials: Passwords generated at runtime
Prerequisites
- Docker installed and running
- Sufficient permissions for Docker operations
pwgenfor password generation (WordPress setup)dialogfor interactive menus
Configuration
Port Management
Scripts automatically detect port conflicts and adjust:
- MySQL: Defaults to 3306, falls back to 3307 if occupied
- Applications: Configurable port mapping
Domain Setup
Most web applications support virtual host configuration for reverse proxy setups.
File Structure
dockerScripts/
├── README.md # This file
├── menu.sh # Interactive menu system
├── dmenu.sh # Dialog-based menu
├── menuitems.lst # Menu items list
├── setup*.sh # Application setup scripts
├── clean*.sh # Cleanup utilities
├── docker*.sh # Backup/restore tools
├── *.sh # Additional utilities
└── updateTheFatCyclist # Specific update script
Contributing
When adding new setup scripts:
- Follow the naming convention
setup<Application>.sh - Include syntax validation and help text
- Use consistent variable naming
- Add error handling for missing parameters
- Update the menu system accordingly
License
Scripts to easily get containers up and running.