svenvanderwegen / dockerizer
A PHP package to create a Dockerfile for your Laravel project
dev-master
2025-06-04 20:47 UTC
Requires
- php: ^8.3.0
- laravel/framework: ^11.0|^12.0
- symfony/yaml: ^7.0
Requires (Dev)
- laravel/pint: ^1.18.1
- mockery/mockery: ^1.6
- orchestra/canvas: ^10.0
- pestphp/pest: ^3.5.1
- pestphp/pest-plugin-type-coverage: ^3.1
- phpstan/phpstan: ^1.12.7
- rector/rector: ^1.2.8
- symfony/var-dumper: ^7.1.6
This package is auto-updated.
Last update: 2025-07-04 21:01:01 UTC
README
Dockerizer
Dockerizer is a command line tool that helps you create Docker images for your PHP applications. It generates a Dockerfile
and a docker-compose.yml
file based on your application's configuration.
Installation
You can install the package via Composer:
composer require --dev svenvanderwegen/dockerizer:dev-master --prefer-dist
Features & Functionality
Dockerizer provides a streamlined workflow to containerize your PHP application with minimal effort. The core functionality is exposed through two main Artisan commands:
1. dockerizer:setup
- Launches an interactive setup wizard.
- Prompts you to select:
- Container registry (Docker Hub, GitHub, custom, etc.)
- Repository path and (if custom) registry URL
- Database type (MySQL, PostgreSQL, SQLite)
- Optional services: Redis, queue worker, scheduler
- Saves your choices to
.dockerizer/config.json
.
2. dockerizer:build
- Generates all required Docker files for your application based on the configuration.
- Creates:
- Dockerfile(s) and service stubs
docker-compose.yml
with all enabled services (app, nginx, database, redis, worker, scheduler, etc.)- Necessary directories and GitHub Actions workflow files
- Supports a
--force
option to overwrite existing files
Modular Service Classes
- Each Docker service (App, Nginx, Database, Redis, Worker, Scheduler) is encapsulated in its own class.
- Only services enabled in your configuration are included in the generated compose file.
- Easily extendable for additional services.
Requires PHP 8.3+
Dockerizer was created by Sven Vanderwegen under the MIT license.