All projects

Creator & Maintainer · 2021 — present

DockR

Integration for Laravel — Docker

DockR lets your Laravel projects run with Docker seamlessly for the local development environment. It's a Bash-scripted CLI that maintains containers for multiple Laravel projects at once — shared database and Redis containers, domain-name proxying, and global scripts mean no per-project Docker files cluttering your repo.

DockR — Integration for Laravel — Docker

Type

Open-source CLI tool

Written in

Bash / Shell

Origin

Apple M1 / ARM transition

PHP versions

5.6 – 8.5

Platforms

Intel (x86) & ARM (M1+)

Install

macOS · Linux · Windows (WSL)

License

MIT

Latest

v1.5

Overview

DockR is a package that interacts with Docker and Laravel to maintain containers for the local development of Laravel apps, managing multiple projects simultaneously. It's written entirely in Bash.

Laravel Homestead worked well for years — until Apple launched Macs with the M1 chip, an ARM-based SoC. Virtual-machine providers couldn't update for the new architecture, so Homestead lost support. The search for an alternative that runs on both Intel (x86) and ARM led to Docker: container-based, lightweight, portable, multi-architecture, and lighter on memory than a full VM.

Docker alone, though, adds friction for developers, and Laravel Sail gives each project its own server-and-database containers — heavy on memory when you run many projects, and awkward when several apps need to share one database. DockR fixes exactly that: shared containers for database and Redis, global scripts so nothing Docker-related lands in your repo, shortcuts for artisan and composer, and extra commands to manage the containers themselves.

Key features

  • Supports nearly all PHP versions (5.6 through 8.5), set per project via DOCKR_PHP_VERSION
  • Proxies incoming requests through a domain name of your choice (project.test) instead of localhost:xxxx — Docker auto-assigns the port and DockR wires it to the proxy
  • Common shared asset containers for MySQL, Postgres, and Redis — multiple projects can connect to the same database instead of running one stack each
  • Global scripts run every project, so no Docker files are committed into your repository
  • Customization: use the built-in image (most packages and extensions included) or build and point to your own via DOCKR_DOCKER_IMAGE
  • Per-project Composer version selection (2.2.0 by default, or 1.8.6) via DOCKR_COMPOSER_VERSION
  • Worker mode (DOCKR_WORKER) spins up a separate container running a scheduler and two queue listeners
  • Auto-creates the database named in DB_DATABASE inside the mysql/postgres connection on startup
  • Convenience by design: every feature is toggled with a DOCKR_ environment variable in your project's .env

Architecture

~/projects/dockr/architecture.md

DockR is, at its core, a Bash script that shortens otherwise hilariously large Docker commands — improving the Docker developer experience without compromise. It orchestrates per-project containers alongside shared asset containers (a proxy plus MySQL, Postgres, and Redis), all configured through DOCKR_ variables in each project's .env. The default image ships from Docker Hub (sharanvelu/laravel-php) with a companion proxy image, and the supporting docs site, CLI, proxy image, and project image each live in their own repository. It is intended for local development only — not recommended for production.

What I did

  • Designed and built the CLI from scratch in Bash as the sole creator and maintainer
  • Architected the shared-asset-container model (proxy, MySQL, Postgres, Redis) so multiple projects reuse one database and Redis stack
  • Implemented domain-name proxying, per-project PHP and Composer version selection, worker (scheduler + queue) containers, and automatic database creation
  • Built artisan/composer shortcuts and container-management commands (up, down, stop, config, asset, migrate, seed, queue, tinker, and more)
  • Published and maintain the supporting Docker images (laravel-php, dockr-proxy) on Docker Hub and authored the documentation site
  • Maintain it as an open-source project under the MIT License at dockr.in

Outcomes

Outcome 01

Born from the Apple M1 (ARM) transition that broke Homestead — Docker was chosen so it runs on both Intel (x86) and ARM architectures

Outcome 02

Replaces the per-project container model (à la Laravel Sail) with shared asset containers, cutting memory use when running many projects at once

Outcome 03

Reduces lengthy local project setup to a single `dockr up` command

Outcome 04

Released under the MIT License and maintained as an open-source project at dockr.in; Python support is in a testing phase, with Ruby and Rails planned

How it compares

vs

Laravel Sail

A great tool for developing Laravel apps, but it supports only PHP 8.0 and 8.1 — limiting for older apps that are hard to migrate — and can't cleanly connect multiple projects to the same database, nor proxy requests through a domain name.

vs

Laravel Homestead

The long-time go-to for local Laravel development, but it doesn't support the ARM-based Apple chips (M1, M2, M3, …) — the very gap that prompted DockR.

Stack

08 tools

BashShellDockerPHPComposerMySQLPostgresRedis