KumbiaPHP project containerized with Docker Swarm, MySQL and configurable versions.
- KumbiaPHP: PHP MVC framework with configurable version
- Web Server Choice: Apache or Nginx with PHP-FPM configurable
- MySQL: Database with configurable version
- Docker Swarm: Orchestration with high availability
- phpMyAdmin: Web interface to manage MySQL
- Flexible versions: Configure PHP, KumbiaPHP and MySQL versions
- Auto-configuration: Automatic database and structure configuration
- Automated scripts: Simplified build and deploy
kumbia/
βββ Dockerfile # Main KumbiaPHP image
βββ docker-compose.yml # Docker Swarm configuration
βββ config.env # Configuration variables
βββ apache-config.conf # Apache configuration
βββ nginx-config.conf # Nginx configuration
βββ supervisord.conf # Supervisor configuration for Nginx+PHP-FPM
βββ init.sh # Container initialization script
βββ build.sh # Script to build the application
βββ deploy.sh # Script to deploy on Swarm
βββ mysql/
β βββ init/
β βββ 01-init.sql # MySQL initialization script
βββ README.md # This documentation
# Versions
KUMBIAPHP_VERSION=1.2.1 # KumbiaPHP version (1.0, beta2, master)
MYSQL_VERSION=8.0 # MySQL version (8.0, 5.7, etc.)
PHP_VERSION=8.4.1 # PHP version (8.1, 8.0, 7.4, etc.)
WEBSERVER=apache # Web server: apache or nginx
# Database
MYSQL_ROOT_PASSWORD=kumbia_root_pass
MYSQL_DATABASE=kumbia_db
MYSQL_USER=kumbia_user
MYSQL_PASSWORD=kumbia_pass
# Application
APP_NAME=kumbia-app # App name
APP_PORT=8180 # App port
MYSQL_PORT=8181 # MySQL port
PHPMYADMIN_PORT=8182 # PhpMyadmin port
# Docker Swarm
REPLICAS=3 # Number of application replicas- Docker Engine 20.10+
- Docker Compose V2
- Git
git clone https://github.com/AFelipeTrujillo/kumbiaphp-docker-swarm
cd kumbiakumbiaphp-docker-swarm# Permissions
chmod +x build.sh deploy.sh init.sh
# Use default configuration
./build.sh
# Specify versions
./build.sh -k v1.2.1 -m 8.0 -p 8.4.1 -w apache
# Use Nginx instead of Apache
./build.sh -w nginx
# Combine options
./build.sh -k v1.2.1 -w nginx -p 8.4.1 -m 8.0
# Rebuild without cache
./build.sh --no-cache# First time (initialize Swarm)
./deploy.sh --init
# Subsequent deployments
./deploy.sh
# Update services
./deploy.sh --update- KumbiaPHP Application: http://localhost:8180
- phpMyAdmin: http://localhost:8182
./build.sh --help # View help
./build.sh -k 1.0 -m 8.0 -p 8.1 # Specific versions
./build.sh -w nginx # Use Nginx web server
./build.sh -w apache # Use Apache web server (default)
./build.sh --no-cache # Build without cache./deploy.sh --status # View services status
./deploy.sh --logs # View all logs
./deploy.sh --logs kumbia-app # Specific logs
./deploy.sh --remove # Remove complete stack# View services
docker stack services kumbia-stack
# View containers
docker stack ps kumbia-stack
# Scale services
docker service scale kumbia-stack_kumbia-app=5
# Update service
docker service update kumbia-stack_kumbia-appThe system automatically configures:
- MySQL connection in
app/config/databases.php - Example users table
- Optimized MySQL configurations
- User: kumbia_user
- Password: kumbia_pass
- Database: kumbia_db
- Host: mysql (inside container)
users (id, username, email, password, created_at, updated_at)Edit config.env or use parameters in build.sh:
# KumbiaPHP v1.0
./build.sh -k 1.0
# KumbiaPHP beta2
./build.sh -k beta2
# Specific branch
./build.sh -k master- KumbiaPHP: 1.0, beta2, master, or any branch/tag
- PHP: 8.1, 8.0, 7.4, etc.
- MySQL: 8.0, 5.7, etc.
# 5 application replicas
./build.sh -r 5
./deploy.sh --update- kumbia-app: PHP application with Apache or Nginx (configurable)
- mysql: MySQL database
- phpmyadmin: Web interface for MySQL
mysql_data: MySQL persistent dataapp_data: Application data./app: Local mount for development
kumbia_network: Overlay network for service communication
Error: Docker Swarm not active
./deploy.sh --initService not responding
./deploy.sh --logs kumbia-app
./deploy.sh --statusDatabase not connecting
./deploy.sh --logs mysql
# Check variables in config.envRebuild from scratch
./deploy.sh --remove
./build.sh --no-cache
./deploy.sh --init# Real-time logs
./deploy.sh --logs kumbia-app
# All services logs
./deploy.sh --logsapp/ # Complete KumbiaPHP Framework Project
βββ core/ # KumbiaPHP Framework Core
β βββ kumbia/ # Core framework components
β βββ libs/ # Core libraries
β βββ views/ # Core views and layouts
β βββ extensions/ # Framework extensions
β βββ console/ # Command line tools
β βββ tests/ # Core tests
βββ default/ # Default KumbiaPHP Application
β βββ index.php # Entry point
β βββ public/ # Public assets (CSS, JS, images)
β βββ app/ # Application code
β βββ controllers/ # Application controllers
β βββ models/ # Data models
β βββ views/ # Application views
β βββ config/ # Configuration files
β βββ libs/ # Application libraries
β βββ locale/ # Internationalization
β βββ temp/ # Temporary files
β βββ tests/ # Application tests
β βββ extensions/ # Custom extensions
β βββ bin/ # Executable scripts
βββ vendor/ # Composer dependencies
βββ .git/ # Git repository
βββ composer.json # Composer configuration
βββ .gitignore # Git ignore rules
βββ .htaccess # Apache configuration
βββ .travis.yml # CI/CD configuration
βββ .phpmd.xml # PHP Mess Detector config
βββ README.md # Project documentation
βββ LICENSE # License file
The app/ directory is mounted as a volume, allowing real-time development without rebuilding the image.
- Fork the project
- Create feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -am 'Add new feature') - Push to branch (
git push origin feature/new-feature) - Create Pull Request
This project is under the MIT License. See LICENSE for more details.
- KumbiaPHP Documentation: https://www.kumbiaphp.com/
- Docker Swarm: https://docs.docker.com/engine/swarm/
- Issues: Create issue in the repository
Ready to develop with KumbiaPHP and Docker Swarm!