# reach-digital/docker-devbox

> Reach Digital Docker+local hybrid development environment.

`composer require reach-digital/docker-devbox`

Canonical URL: https://packagento.com/reach-digital/docker-devbox

## At a glance

- **Vendor**: reach-digital (https://packagento.com/reach-digital.md)
- **Latest version**: 5.0.2 — released 2025-12-18
- **Pricing**: Free
- **Package type**: Magento 2 component
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/reach-digital/docker-devbox and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require reach-digital/docker-devbox:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Reach Digital Docker+local hybrid development environment.

## README

Docker for services, PHP locally. No sync, no mental overhead, no performance
penalties.

Services included: `php`, `nginx`, `https`, `http/2`, `varnish`, `mysql`,
`elasticsearch`, `rabbitmq`, `mailcrab`.

PHP runs outside of Docker for optimal performance and being able to just run
your tooling (i.e. `bin/magento`) from your local terminal.

Due to Docker VMM's improved performance, we use bind mounts to share files for
the services that need it (`nginx`). We use guest-only volumes for services
that don't need to share data for optimal performance (`mysql`, `elasticsearch`,
etc.)

### Goals

- It should be possible for a frontend developer without any backend skills to
  easily set up a development environment.
- It should be possible for a backend developer to add or upgrade services.
- It should be possible for a backend developer to propagate the changes to the
  rest of the team with version control.

### Principles

- No magic: As few CLI tools that will automatically 'fix' things. Do not use
  wrappers around existing tools: docker / etc. Exception: php runs locally,
  needs to be set up.
- Declarative: Developer should define the final state instead of running
  upgrade scripts (hence, docker).
- Minimal: Use as few cpu cycles and memory as possible.

### Requirements

- Recent macOS
- Recent Docker
- Apple Silicon (for Docker VMM support)

### Global installation (only once)

#### Cleanup your system

Since we're running some things locally it probably is a good time to clean some
stuff up.

- Run `brew doctor` and make sure you don't have errors.
- Run `brew update` to update to the latest version.

You should not have any services running like.

- `php`: find them with `brew list | grep php`, uninstall them using
  `brew uninstall —f <packages>`. With the force flag you'll delete all
  installed versions of formula.
- `httpd`:
  [Disable apache](https://apple.stackexchange.com/questions/119674/disable-apache-autostart/119678)
  that is OSX native. http://localhost/ should not return anything.
- `mysql`: uninstall or disable mysql, or at least make sure it doesn't run on
  the default MySQL port.
- `nginx`: uninstall

Take a look at `~/.bash_profile` or `~/.zshrc` and make sure it doesn't contain
any references to `$BREW_PREFIX/Cellar/php*`.

#### Installing PHP and php-fpm services

Since we're running a hybrid docker+local system we need to set up PHP to run
locally. An `install.sh` script is provided for this, which you can run locally
after cloning this repository.

For running the script directly, use:
```bash
## Cleans existing brew php (will not remove Valet stuff) + installs php on macOS
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ho-nl/docker-development-box/master/install.sh)"
```

It will (re)install multiple php-fpm services, one for each version (port: 9072,
9073, 9074, etc.) and one for each version with xdebug (port: 9172, 9173, 9174, etc.).

##### Switching between PHP versions

You can switch between CLI PHP versions using `brew link`. For example to switch to 8.2:

```bash
brew unlink php@8.2 && brew link --force --overwrite php@8.2
```

Should now show the right version (check with `php -v`). If it doesn't there might be still be a
version linked, or your ~/.bash_profile should be cleaned up, or you need to
reopen your CLI.

For easy switching between versions you can set up aliases like so:

```shell
alias link-php74='brew unlink php@7.4 && brew link --force --overwrite php@7.4'
alias link-php81='brew unlink php@8.1 && brew link --force --overwrite php@8.1'
alias link-php82='brew unlink php@8.2 && brew link --force --overwrite php@8.2'
alias link-php83='brew unlink php@8.3 && brew link --force --overwrite php@8.3'
alias link-php84='brew unlink php@8.4 && brew link --force --overwrite php@8.4'
```

#### Install docker

1. Install latest version of 
   [docker for mac]([https://docs.docker.com/desktop/release-notes/]).
2. Start Docker
3. Exclude `~/Library/Containers` from your backups
4. `brew install ctop`: can be used to show container metrics.
5. Open Docker -> Settings -> Resources, set memory to 6-8 GB
7. Open Docker -> Settings -> General, set virtual machine manager
   to Docker VMM

#### Install local certificate

- Download the raw .pem file (Open Raw, then CMD + S):
- [./hitch/\*.localhost.reachdigital.io.pem](./hitch/*.localhost.reachdigital.io.pem)
- Open keychain.app, add this file (you can drag and drop this file in the keychain
  app, under the `Login` tab).
- Open certificate and trust the certificate (do this by right-clicking on the entry,
  choosing 'Get Info', and choose 'Always trust' under the 'Trust' section)

You are now done with the global installation 🎉

### Project installation

This covers initially adding docker-devbox support to a Magento project; if your project
already has docker-devbox support added, please refer to the projects' own README.

_(README truncated for .md surface. Full README on https://packagento.com/reach-digital/docker-devbox.)_

## Changelog

All notable changes to this project will be documented in this file, in reverse
chronological order by release.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [HEAD]

#### Added

- Varnish bypass for blackfire.io
- Install: Added zsh support
- Magento: Added static-content-deploy relative symlink patch.

#### Changed

- Revert: Mysql: Disable stats for SHOW TABLE STATUS to improve performance.
- Install: Cleaned output of install script
- Install: Hide launchctl unload warning
- Install: Better success message

### [1.0.0-preview.1] - 2020-02-25

#### Changed

- Updated README to make installation more clear.
- Mysql: Disable stats for SHOW TABLE STATUS to improve performance.

### [1.0.0-preview.0] - 2020-02-24

#### Added

- Initial Release of the **🐳 Reach Digital Magento 2 Docker+local hybrid
  development environment. 🐳**: Docker for services, php locally. No sync, no
  mental overhead, no performance penalties.
- Supported srevices: `php`, `nginx`, `https`, `http/2`, `varnish`, `mysql`,
  `elasticsearch`, `rabbitmq`, `mailhog`

## Recent Versions

| Version | Released |
|---|---|
| 5.0.2 | 2025-12-18 |
| 5.0.1 | 2025-08-06 |
| 5.0.0 | 2025-08-06 |
| 4.4.0 | 2025-07-01 |
| 4.3.2 | 2025-02-04 |
| 4.3.1 | 2025-02-03 |
| 4.3.0 | 2025-01-10 |
| 4.2.0 | 2024-07-16 |
| 4.1.1 | 2023-11-22 |
| 4.1.0 | 2023-11-21 |

Showing 10 of 52 versions. Full release history on https://packagento.com/reach-digital/docker-devbox.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/magento-composer-installer | * |

## Quality

Latest release (5.0.2) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 1 | 1 warning (ruleset: Magento2) |
| PHPMD | Pass | 0 |  |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["reach-digital/docker-devbox"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

reach-digital is a Magento 2 vendor on Packagento. See https://packagento.com/reach-digital.md for their full catalogue.

