serversideup/spin
Spin is a Docker-based local development environment for Laravel that gets projects running quickly with preconfigured PHP, database, and caching services, so you can develop without installing PHP, Composer, or Node locally.
Architecture fit
bin/spin + one file per command under lib/actions/) over docker compose, with Docker images used as the execution vehicle for Ansible, GitHub CLI, Node, and PHP tooling. There is no PHP library surface, no Composer package, and no runtime coupling to the Laravel application — it never enters the application’s dependency graph or request lifecycle.docker-compose.yml plus an environment overlay (docker-compose.$SPIN_ENV.yml) reproduces a production-shaped stack locally with spin up. That makes it a developer-experience layer, not an architectural component.Integration feasibility
composer.json change. There is nothing to add to composer.lock, nothing to build, and nothing in the deployable artifact.Makefile target or npm-style script alias so developers can adopt Spin incrementally without the team rewriting muscle memory or CI scripts on day one.Technical risk
mapfile) makes upstream contributions slower than a typical library.spin provision and spin deploy touch servers and Swarm. Those commands must be explicitly out of scope for the initial rollout, or governed by a separate ops review — that is a different risk class than "makes local dev nicer."Key questions
provision and deploy in scope at all, or is this strictly a up/down/exec/logs/build/run decision for now?.env files set COMPOSE_FILE, SPIN_ENV, or COMPOSE_CMD, and would Spin’s defaults silently override them?Stack fit
serversideup/php images with a Compose v2 workflow. The default serversideup/php:cli and Node images align with the broader serversideup toolchain (docker-php, Ansible collection, GitHub Actions), so choosing Spin is really a decision to lean into that ecosystem.Migration path
docker-compose.yml untouched as the source of truth; add a docker-compose.dev.yml overlay rather than rewriting service definitions.spin up / spin down / spin exec as an alternative, not a replacement, for one sprint.Makefile (or composer script) facade so make up, make test, make migrate route to Spin internally. This decouples developer habits from the tool and gives a single place to swap implementations later.Compatibility
COMPOSE_FILE with : separators) is the main collision risk with existing environment variables; audit and namespace before enabling.SPIN_USER_ID) is a genuine plus for Linux file-permission pain, and should be validated on the Linux cohort during the PoC.spin run -T / spin exec -T is required to disable TTY allocation — worth codifying in the team’s command conventions up front, since omitting it produces confusing hangs.Sequencing
spin up from clean clone to working app in under 15 minutes, no manual steps.Makefile facade, confirm GPL clearance for the intended use.spin run in CI and only then open a separate review for provision/deploy with the infrastructure owner.Maintenance
Makefile facade, any preflight scripts) is the part we maintain. Keep it under ~50 lines so it never becomes a second product.Support
--remove-orphans is applied automatically on up/down; developers with non-standard container names should be warned, since it can remove containers they did not expect.Scaling
Failure modes
--skip-pull / --force-pull as the escape hatches.COMPOSE_FILE, SPIN_ENV) → silent, hard-to-diagnose misconfiguration; this is the failure mode most worth pre-empting.sed/base64/readlink differences) → upstream’s problem, but it means bug reports should include OS and ShellCheck-level detail.deploy, provision) → highest severity, lowest probability if scoped out; keep them out of the initial rollout and out of developer muscle memory.Ramp-up
spin equivalents.Makefile facade, pinned and documented; explicitly exclude provision/deploy from scope; revisit only if onboarding time or environment-drift tickets fail to improve.How can I help you explore Laravel packages today?