PHPackages                             plan-com/docker-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. plan-com/docker-generator

ActiveLibrary[CLI &amp; Console](/categories/cli)

plan-com/docker-generator
=========================

A PHP library to generate Docker files via an Artisan command.

1.0.2(1y ago)04.4k↓33.3%MITPHPPHP ^8.3

Since Apr 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rjakubiak-plancom/laravel-docker-generator)[ Packagist](https://packagist.org/packages/plan-com/docker-generator)[ RSS](/packages/plan-com-docker-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Docker files generator
======================

[](#docker-files-generator)

Laravel package that provides an Artisan command to quickly generate all the essential Docker configuration files.
Included php 8.3, mysql, nginx, redis and xdebug enabled. Good alternative for sail when you want to have more controller

Features
--------

[](#features)

- **Single Artisan Command:** Run one command to generate your complete Docker configuration.
- **Dynamic Placeholder Replacement:** Replace the `{{prefix}}` placeholder in your stub files with a custom project prefix.
- **No Extra Configuration Needed:** Uses the built-in stubs contained in the package.
- **Seamless Laravel Integration:** Perfectly designed for Laravel applications.
- **Tested and Reliable:** Comprehensive tests ensure the command works as expected in your application.

Installation
------------

[](#installation)

Add the package to your Laravel project using Composer:

```
composer require plan-com/php-docker-generator
```

Usage
-----

[](#usage)

Generate files

```
php artisan generate:docker {prefix}

```

Replace {prefix} with your desired project prefix. For example, if you want to prefix all container names with myproject, run:

```
php artisan generate:docker myproject

```

Remove Files(clean project)

```
php artisan remove:docker-generator

```

Build docker environment after
------------------------------

[](#build-docker-environment-after)

Handful make commands included for project management.

```
make build # first command to run to actually build docker envoirenment
make composer-install
make migrate
make migrate-test
make phpstan #requires phpstan installed

```

What Happens When You Run the Command
-------------------------------------

[](#what-happens-when-you-run-the-command)

### Stub Files Are Loaded:

[](#stub-files-are-loaded)

The command loads the built-in stub files from the package's stubs/ directory. These files include:

```
docker-compose.yml.stub
Dockerfile.stub
Makefile.stub
.env.docker.dist.stub

```

### Dynamic Replacement:

[](#dynamic-replacement)

In each stub, every occurrence of {{prefix}} is replaced with the value you provide (myproject in this example).

### File Generation:

[](#file-generation)

The processed files are then written to your Laravel application's file system in the following locations:

`docker-compose.yml` – Located in the root directory, this file defines your Docker services with names incorporating the provided prefix.
`docker/basic/Dockerfile` – Located in a subdirectory (i.e. docker/basic/), this file contains the Docker build instructions for your PHP container.
`Makefile` – Placed at the project root, it includes commands (e.g., for running Docker and Artisan operations) that reference your prefixed service names.
`.env.docker.dist` – Also in the project root, this file acts as a template for any environment variables needed by your Docker configuration.

### Overriding some variables

[](#overriding-some-variables)

In .env.docker.dist there are some variables you can use in .env file like
`COMPOSE_PROJECT_NAME` - sets a name for docker environment project name
`DOCKER_OUTPUT_DIR` - sets where to put docker files like Dockerfile

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance46

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4016c4d88c641c232468df0260e986a5651b42cba4ca0e2c3c4f8b88c79953c?d=identicon)[rjakubiak-plancom](/maintainers/rjakubiak-plancom)

---

Top Contributors

[![rjakubiak-plancom](https://avatars.githubusercontent.com/u/207018075?v=4)](https://github.com/rjakubiak-plancom "rjakubiak-plancom (3 commits)")

### Embed Badge

![Health badge](/badges/plan-com-docker-generator/health.svg)

```
[![Health](https://phpackages.com/badges/plan-com-docker-generator/health.svg)](https://phpackages.com/packages/plan-com-docker-generator)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[bestmomo/nice-artisan

Web interface for Laravel Artisan

215149.3k](/packages/bestmomo-nice-artisan)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)[mwguerra/web-terminal

A web-based terminal component for Filament/Laravel with command whitelisting and multiple connection types

251.1k](/packages/mwguerra-web-terminal)[sunaoka/laravel-facade-generator

Provide command line generation of facade layer files.

171.9k](/packages/sunaoka-laravel-facade-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
