A comprehensive Docker development environment featuring MariaDB and FrankenPHP for rapid PHP application development.
- Download this repository as a ZIP file from GitHub
- Extract to your desired project directory
- Open terminal in the extracted folder
- Continue with Getting Started
# Clone the repository
git clone https://github.com/bravedave/frank your-project-name
cd your-project-name
# Remove git history to start fresh
rm -rf .git
# Initialize your own git repository (optional)
git init- Docker installed and running
- Docker Compose (included with Docker Desktop)
This repository provides a ready-to-use shell Docker environment that combines the power of MariaDB database server with FrankenPHP - a modern application server that's truly a Swiss Army knife for PHP developers. FrankenPHP offers exceptional performance with built-in HTTP/2, HTTP/3, and real-time features, making it perfect for both development and production environments.
- Latest MariaDB image with persistent data storage
- Custom server configuration via
my.server.cnf - Environment-based configuration for database credentials
- Persistent data volumes mapped to
./workspace/mariadb
- Built on the official
dunglas/frankenphpimage - Pre-installed MariaDB connector (mysqli extension)
- Composer - PHP dependency manager pre-installed and ready to use
- Git, zip, and unzip utilities included
- HTTP/80, HTTPS/443, and HTTP/3 (443/udp) ports exposed
- Custom Caddy configuration support
├── app/ # Your application development folder
│ └── public/ # Publicly exposed web files
├── workspace/ # Persistent data and configuration
│ ├── mariadb/ # MariaDB data directory
│ └── root/ # Container root directory mapping
├── Caddyfile.d/ # Custom Caddy server configuration
├── docker-compose.yaml # Docker Compose configuration
├── Dockerfile # FrankenPHP container build configuration
└── my.server.cnf # MariaDB server configuration
- Development-Ready: The
app/folder is mapped for live development - changes reflect immediately - Web Root: The
public/directory serves as your publicly accessible web folder - Database Integration: MariaDB connector pre-installed and ready to use
- Persistent Storage: Database and configuration files persist across container restarts
- Modern Standards: HTTP/2, HTTP/3, and HTTPS support out of the box
-
Complete the Installation steps above
-
Run the setup script to create your environment:
./setup-environment.sh
This script will:
- Generate a secure MySQL password
- Create the
.envfile with database configuration - Set up the workspace directory structure
- Create
.my.cnffor easy database access from within containers - Create
app/public/directory with a defaultindex.phpfile - Set up
app/.vscode/settings.jsonwith SQLTools database connection for VS Code
-
Build and start the containers:
docker compose up -d --build
-
Access your application at
http://app.localhostorhttps://app.localhost
The setup-environment.sh script automatically creates:
.envfile: Contains all database credentials and configurationworkspace/root/.my.cnf: MySQL client configuration for easy database access from containers- Database setup: Creates
cmsxdatabase with secure random password app/public/index.php: Default PHP file with "Hello World" message and phpinfo() output
After setup, you can connect to the database from within the FrankenPHP container using the MySQL client without needing to specify credentials.
Place your PHP files in the app/public/ directory and start coding! The environment automatically serves your files through FrankenPHP with full MariaDB connectivity available.
Composer is pre-installed in the FrankenPHP container. You can use it from within the container:
# Enter the container
docker compose exec frankenphp bash
# Use composer commands
composer init
composer require vendor/package
composer installYour composer.json and vendor/ directory should be placed in the app/ folder to persist across container restarts.
Special thanks to the amazing projects that make this environment possible:
- FrankenPHP - The modern PHP application server that revolutionizes PHP development
- MariaDB - The reliable, high-performance database server
- Docker - The containerization platform that makes this environment portable and consistent
- Caddy - The powerful web server with automatic HTTPS (integrated into FrankenPHP)
- Composer - The PHP dependency manager for package management
- PHP - The versatile scripting language powering web development
Jump into the container with VSCode and start Developin !!