Cloud, Data & AI
Docker for Development Teams: One Setup That Works on Every Laptop
A shared Docker setup ends days of onboarding and bugs that only appear on one machine. Here is how we build a Compose-based development environment that runs the same on macOS, Windows and Linux, and stays fast enough for developers to use.

A new developer joins and spends the first two days getting the project to run. Their laptop has a different PHP or Node.js version, the database is a major version behind production, a search service the app quietly depends on is missing, and the setup notes in the README were last accurate three years ago. Meanwhile bugs appear that nobody else can reproduce, because every machine is configured slightly differently.
A shared Docker setup fixes most of this, and it is usually where our Docker and Kubernetes work begins, long before anyone mentions production clusters. Here is how we set one up so it runs the same way on macOS, Windows and Linux laptops and stays fast enough that developers actually use it.
What Docker Fixes, and What It Does Not
Docker packages the runtime and the services around it, so the whole team runs the same versions of everything:
- The language runtime and extensions: PHP with the right modules, a specific Node.js or Python version.
- Supporting services: PostgreSQL or MySQL, Redis, a search engine, a queue, and a local mail catcher such as Mailpit so test emails never reach real people.
- System libraries that are painful to install by hand, such as image processing or PDF tools.
It does not fix missing test data, unclear configuration or a messy codebase. It also does not mean you must run Kubernetes in production; plenty of teams use Docker locally and deploy to a single server, which our guide on whether you actually need Kubernetes discusses.
One Compose File for the Whole Stack
The heart of the setup is a single Compose file in the repository that starts everything with docker compose up. The details that make it reliable:
- Pin versions to match production. Use postgres:16 or redis:7, never latest. A local database a major version ahead of production hides real problems.
- Add health checks. With depends_on and condition: service_healthy, the application waits until the database is genuinely ready instead of failing on the first connection.
- Keep data in named volumes so it survives restarts, with a documented command to wipe and rebuild it.
- Use profiles for optional services. Not everyone needs the search engine or the queue worker running all day; profiles let them start only when asked for.
- Commit an .env.example with safe local defaults, so a fresh clone works without asking anyone for values.
One Dockerfile for Development and Production
Maintaining a separate Dockerfile for laptops and servers lets them drift apart. A multi-stage Dockerfile avoids that:
- A base stage with the runtime and system packages both environments need.
- A development stage that adds debugging tools such as Xdebug, test runners and file watchers.
- A production stage that installs only runtime dependencies, copies the built application, and runs as a non-root user.
Compose points at the development stage with a target setting; the build pipeline builds the production stage. Copy lock files and install dependencies before copying the source, so Docker's layer cache skips reinstalling packages when only code changes, and keep a .dockerignore so local dependencies, logs and secrets never end up in the image.
Keeping It Fast on Every Laptop
The quickest way to lose a team's goodwill is a containerised setup that is noticeably slower than running things natively. The usual causes and fixes:
- File sharing on macOS and Windows. Docker runs inside a lightweight virtual machine there, and syncing large dependency folders across that boundary is slow. Mount your source code, but keep vendor or node_modules inside the container in a named volume.
- Windows. Keep the project inside the WSL 2 filesystem rather than on the Windows drive; the difference in file access speed is large.
- Apple Silicon. Use images published for arm64. Images built only for amd64 run under emulation and can be painfully slow, so check every base image and build your own for both architectures.
- Watch mode. Compose's watch feature can sync changed files and rebuild only when dependency files change, which suits front-end tooling well.
- Resources. Give the Docker virtual machine enough memory for the database and the build tools, or everything slows down together.
Data, Seeds and Secrets
A new laptop should end up with a working application containing realistic data, without anyone emailing a database dump around. We write seed scripts that create representative customers, orders and content, and run migrations on start-up or through a single command. Copies of production data with personal information should not sit on laptops at all; if real data shapes are needed, use an anonymised extract.
Local secrets stay in an uncommitted .env file and should be test or sandbox keys only: sandbox payment gateways, test mail servers, development API keys. If a laptop is lost, nothing of value should be on it.
Make Common Tasks a Single Command
Nobody should need to remember long docker compose exec commands. A Makefile or small scripts give the team a shared vocabulary:
- make up and make down to start and stop the stack.
- make fresh to rebuild the database and reseed it.
- make test to run the same test suite the build pipeline runs.
- make shell to open a terminal inside the application container.
Using the same images and commands in continuous integration means a test that passes locally passes in the pipeline too; we set that up as part of our cloud hosting and DevOps work. One licensing note: Docker Desktop is free for individuals and small businesses, but larger organisations need a paid subscription under Docker's terms, so check where you fall. Alternatives such as Rancher Desktop or Colima run the same Compose files.
Bringing an Existing Project Into Docker
Older applications can be containerised too, and it is often the first step in modernising them. We start by matching production exactly, even if production is running an old PHP version, so behaviour does not change. Once the team develops in containers, upgrading the runtime becomes a one-line change that everyone tests together. We do this regularly for Laravel and PHP and Node.js applications, and the same approach suits Python, Java and .NET projects.
If onboarding takes days or bugs only appear on certain machines, tell us about your stack and how the team works. We will set up a Docker environment your developers can start with one command, and hand it over with documentation they can maintain.
Frequently Asked Questions
Is Docker slower than running the application directly on a laptop?
On Linux the difference is negligible. On macOS and Windows, Docker runs inside a virtual machine, so file-heavy work can be slower if large dependency folders are shared with the host. Keeping dependencies inside the container, using the WSL 2 filesystem on Windows and arm64 images on Apple Silicon usually brings performance close to native.
Do we need Kubernetes if we use Docker for development?
No. Docker for local development and Kubernetes for production are separate decisions. Many applications use Docker on laptops and deploy the same image to a single server with Docker Compose, or to a managed container platform. Kubernetes only makes sense when the production workload needs what it offers.
How long does it take to containerise an existing project for development?
For a typical web application with a database, cache and queue, a working development setup usually takes a few days, including seed data and documentation. Older projects with unusual system dependencies or undocumented services take longer, mostly because those dependencies have to be discovered first.
Can designers or front-end developers use the same Docker setup?
Yes, and that is one of the main benefits. With a single start command and seeded data, anyone on the team can run the full application without installing databases or language runtimes. Optional services can be left switched off with Compose profiles, so the stack stays light for people who only work on the front end.
Should we use production database copies in local Docker environments?
We advise against it when the data contains personal information, because it ends up on laptops that can be lost and outside your access controls. Seed scripts with realistic sample data cover most needs. Where real data shapes are essential for debugging, use an anonymised extract with names, emails, addresses and payment details replaced.











