A Docker-based deployment system for October CMS.
This project provides a streamlined way to deploy, manage, and maintain October CMS installations using Docker containers with flexible, composable configuration.
- Minimal host dependencies - Only requires Bash and Docker
- Template composition - Modular YAML templates for flexible configuration
- Interactive setup wizard - Guided first-time configuration
- Health diagnostics - Built-in doctor tool for troubleshooting
- Multiple deployment modes - Standalone, multi-container, dev, and production
- Automatic SSL - Let's Encrypt integration for free HTTPS
- Resource auto-tuning - Automatic optimization based on system resources
- Docker 20.10 or later
- Bash (Linux, macOS, WSL, or Git Bash on Windows)
- 2GB+ RAM recommended
- 5GB+ disk space
Note: Unlike typical PHP projects, you don't need PHP, Composer, or any other dependencies installed on the host. All PHP operations run inside Docker containers.
-
Clone this repository:
git clone https://github.com/yourusername/october-docker.git cd october-docker/october -
Run the setup wizard:
./october-setup
-
Or manually configure and bootstrap:
cp samples/standalone.yml containers/app.yml # Edit containers/app.yml with your settings ./launcher bootstrap app -
Access your site at the configured URL!
- Install Docker Desktop
- Install Ubuntu (via Microsoft Store)
- Turn on Docker Desktop WSL 2 (Settings → General → Use WSL 2 Based Engine)
- Turn on WSL integration with Ubuntu (Settings → Resources → WSL Integration)
On Windows, use Git Bash, WSL, or any Bash-compatible shell:
# Git Bash
./october-setup
# Or use the batch wrapper
october-setup.bat| Command | Description |
|---|---|
./launcher start app |
Start the container |
./launcher stop app |
Stop the container |
./launcher restart app |
Restart the container |
./launcher rebuild app |
Destroy and rebuild |
./launcher enter app |
Open a shell inside |
./launcher logs app |
View container logs |
./launcher logs app -f |
Follow logs in real-time |
./launcher artisan app migrate |
Run artisan commands |
./launcher bootstrap app |
Create new container |
./launcher destroy app |
Remove container |
./launcher cleanup |
Remove stopped containers |
./october-setup # Interactive configuration wizard
./october-doctor # Health check and diagnosticsoctober/
├── launcher # Main CLI tool (Bash)
├── october-setup # Setup wizard (Bash)
├── october-doctor # Diagnostics tool (Bash)
├── image/ # Docker images
│ ├── base/ # Base production image
│ ├── dev/ # Development image
│ └── prod/ # Optimized production image
├── templates/ # YAML templates
├── samples/ # Sample configurations
├── containers/ # Your container configs (gitignored)
├── shared/ # Persistent data (gitignored)
└── cids/ # Container IDs (gitignored)
Container configurations are YAML files in the containers/ directory:
# containers/app.yml
templates:
- "templates/mysql.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
expose:
- "80:80"
- "443:443"
volumes:
- volume:
host: /var/october/shared/{{ config }}
guest: /shared
params:
repo_url: https://github.com/octobercms/october.git
version: main
php_memory_limit: 256M
env:
APP_KEY: "base64:your-key-here"
APP_URL: "https://example.com"
DB_PASSWORD: "secure-password"
hooks:
after_composer:
- exec:
cd: /var/www/october
cmd:
- sudo -u october composer require rainlab/blog-plugin| Template | Purpose |
|---|---|
mysql.template.yml |
MySQL database server |
redis.template.yml |
Redis for cache/sessions/queues |
web.template.yml |
Apache + PHP + October CMS |
web.ssl.template.yml |
SSL/HTTPS configuration |
web.letsencrypt.template.yml |
Automatic Let's Encrypt |
scheduler.template.yml |
Laravel scheduler (cron) |
queue.template.yml |
Queue workers |
| Sample | Description |
|---|---|
standalone.yml |
All-in-one with MySQL, Redis, web |
standalone-dev.yml |
Development setup with Xdebug |
web-only.yml |
Web container only (external DB) |
data.yml |
Data container (MySQL + Redis only) |
Templates use a YAML-based configuration language with support for:
params:
db_name: october
php_memory_limit: 256M
env:
DB_DATABASE: $db_namerun:
# Execute commands
- exec:
cmd: echo "Hello"
# Execute in directory
- exec:
cd: /var/www/october
cmd:
- composer install
- php artisan migrate
# Create files
- file:
path: /etc/php.ini
contents: |
memory_limit = 256M
# Replace text
- replace:
filename: /etc/apache2/apache2.conf
from: "Timeout 60"
to: "Timeout 300"hooks:
before_code:
- exec: echo "Before cloning code"
after_code:
- exec: composer install
after_migrate:
- exec: php artisan cache:clearFor development with Xdebug:
# Use the dev sample configuration
cp samples/standalone-dev.yml containers/dev.yml
./launcher bootstrap devThe development image includes:
- Xdebug with step debugging
- Development PHP settings
- Node.js for frontend builds
- SQLite for testing
Add these templates to your configuration:
templates:
- "templates/web.template.yml"
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.template.yml"
env:
LETSENCRYPT_EMAIL: "admin@example.com"Place your certificate files in /var/october/shared/app/ssl/:
cert.pem- Certificatekey.pem- Private keychain.pem- Certificate chain
Then add:
templates:
- "templates/web.template.yml"
- "templates/web.ssl.template.yml"Install plugins via hooks in your configuration:
hooks:
after_composer:
- exec:
cd: /var/www/october
cmd:
- sudo -u october composer require rainlab/blog-plugin
- sudo -u october composer require rainlab/user-pluginOr install via the container:
./launcher enter app
php artisan plugin:install RainLab.BlogTo update October CMS:
./launcher rebuild appThis will:
- Pull the latest code from the configured repository
- Run composer install
- Run database migrations
- Clear and rebuild caches
The shared/ directory contains all persistent data:
# Backup
tar -czvf backup-$(date +%Y%m%d).tar.gz shared/app/
# Restore
tar -xzvf backup-20231215.tar.gz
./launcher rebuild appRun the doctor tool to diagnose issues:
./october-doctor appCommon issues:
./launcher logs app # Check logs
./october-doctor app # Run diagnostics./launcher enter app
chown -R october:www-data /var/www/october/storage
chmod -R 775 /var/www/october/storageCheck your containers/app.yml for correct database credentials:
env:
DB_HOST: "127.0.0.1"
DB_DATABASE: october
DB_USERNAME: october
DB_PASSWORD: "your-password"This project follows tooling (launcher, setup wizard, doctor) is written in Bash and requires only Docker on the host machine.
YAML configuration parsing is performed by running PHP inside a Docker container, piping the configuration file to the container for processing. This approach means:
- No PHP installation required on host
- No Composer or dependencies on host
- Works on any system with Bash and Docker