PHPackages                             zero-to-prod/dock - 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. zero-to-prod/dock

ActiveLibrary

zero-to-prod/dock
=================

Docker files for running a basic PHP application.

v1.2.0(1y ago)22.9kMITDockerfilePHP &gt;=7.1CI passing

Since Jan 6Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/dock)[ Packagist](https://packagist.org/packages/zero-to-prod/dock)[ Docs](https://github.com/zero-to-prod/dock)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-dock/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (32)Used By (0)

Zerotoprod\\Dock
================

[](#zerotoproddock)

[![](./art/logo.png)](./art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/dock)[![Packagist Downloads](https://camo.githubusercontent.com/3bb4ca4ece23c4310396c58643ea9e9a7b0d59c83b101430715fd6ca7fabfb59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f646f636b3f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/dock/stats)[![Packagist Version](https://camo.githubusercontent.com/4caaab2e0d58e919b6ee4ed0cc3e6b20242f34ffa244f0f82c2d48f2c6884eca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f646f636b3f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/dock)[![GitHub repo size](https://camo.githubusercontent.com/cddf0149418f7090d81f3c43c691e9954f149108d536c4acb751619a945acbd7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f7a65726f2d746f2d70726f642f646f636b)](https://github.com/zero-to-prod/dock)[![License](https://camo.githubusercontent.com/533fc4ad1c042df16b5bac77c1dde5ed252eee77d01c3baea61b40129471db4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f646f636b3f636f6c6f723d726564)](https://github.com/zero-to-prod/dock/blob/main/LICENSE.md)[![Hits-of-Code](https://camo.githubusercontent.com/1af79161130afd6d10f179e381a5cc4a8982ef7530d87ac83945472f225d2f62/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f646f636b3f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/dock/view?branch=main)[![wakatime](https://camo.githubusercontent.com/a4f15fc1a9b227dfeeb10d20132eed0f741a130583c69a291cfc58c4c6f410a3/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f646f636b2e737667)](https://wakatime.com/badge/github/zero-to-prod/dock)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Supported Php Versions](#supported-php-versions)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Initialization](#initialization)
- [Usage](#usage)
    - [Configuration](#configuration)
    - [Building Containers](#building-containers)
    - [Install Dependencies for a Runtime](#install-dependencies-for-a-runtime)
    - [Commands](#commands)

Introduction
------------

[](#introduction)

Dock provides a Docker powered local development experience for a PHP application. Other than Docker, no software or libraries are required to be installed on your local computer before using Dock. Dock's simple CLI means you can start building your PHP application without any previous Docker experience.

**Why you’ll love it**:

> - **Test Multiple PHP Versions** with one script.
> - **Switch Versions Easily** via `.env` settings.
> - **Comprehensive Docker Support** through docker-compose.
> - **PHP Debugging** already setup across all supported versions.
> - **Available with Composer**.

Supported PHP Versions
----------------------

[](#supported-php-versions)

Compatible with PHP:

- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5

Prerequisites
-------------

[](#prerequisites)

- Docker installed and running

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

[](#installation)

Add `dock` to your project with Composer:

```
composer require zero-to-prod/dock --dev
```

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/dock)
vendor/bin/zero-to-prod-dock

# Publish to custom directory
vendor/bin/zero-to-prod-dock /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-dock"
        ],
        "post-update-cmd": [
            "zero-to-prod-dock"
        ]
    }
}
```

Initialization
--------------

[](#initialization)

Once you have the composer package installed, you can set up Dock in your project directory:

```
./vendor/bin/dock
```

This copies necessary configuration files to your project.

Usage
-----

[](#usage)

Dock includes scripts to build and manage your PHP environments effortlessly.

### Configuration

[](#configuration)

Before starting development, verify that your `.env` file contains the correct settings.

You can specify which PHP version to use for local development, debugging, and Composer operations by updating these variables in your `.env` file:

```
PHP_VERSION=8.1
PHP_DEBUG=8.1
PHP_COMPOSER=8.1
```

### Building Containers

[](#building-containers)

Build Docker containers based on your `.env` PHP versions:

```
sh dock build
```

This will create the following containers:

- php&lt;PHP\_VERSION&gt; (example service: `php7.1`)
- debug&lt;PHP\_VERSION&gt; (example service: `debug7.1`)
- composer&lt;PHP\_VERSION&gt; (example service: `composer7.1`)

### Install Dependencies for a Runtime

[](#install-dependencies-for-a-runtime)

Update Composer dependencies as defined in your `.env`:

```
sh dock composer update
```

### Commands

[](#commands)

There a few commands that come with the default script.

```
sh dock build      # Builds the php, debug, and composer containers
sh dock init       # Initialize the .env file from .env.example if it doesn't exist.
sh dock test       # Run PHPUnit tests using the specified PHP version.
sh dock composer   # Run Composer commands using the specified PHP version.
sh dock   # Run a specified Docker service with optional arguments.
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance57

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

31

Last Release

497d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (12 commits)")

---

Tags

zero-to-proddock

### Embed Badge

![Health badge](/badges/zero-to-prod-dock/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-dock/health.svg)](https://phpackages.com/packages/zero-to-prod-dock)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

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