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.

Close-up of stacked shipping containers in red, blue, orange and green with locking bars and markings

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:

  1. A base stage with the runtime and system packages both environments need.
  2. A development stage that adds debugging tools such as Xdebug, test runners and file watchers.
  3. 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.

How We Can Help

Services Related to This Article

The work we do with the technologies discussed above — with pricing, process and real examples on each page.

  • Docker & Kubernetes

    Applications packaged in Docker, deployed with CI/CD, and run on Kubernetes when they need to scale — with monitoring, secrets and rollbacks built in.

  • Cloud Hosting & DevOps

    AWS, Azure, Google Cloud and DigitalOcean setup, Docker and Kubernetes, CI/CD pipelines, Nginx tuning, monitoring, backups and cost optimisation.

  • PHP & Laravel Development

    Laravel web applications, custom PHP development, admin panels, APIs and legacy PHP upgrades — secure, well-structured and easy to maintain.

  • Node.js Development

    Node.js back-end development: Express and NestJS APIs, real-time services, background jobs, MySQL/MongoDB data layers and Redis caching.

In Practice

Case Studies on This Topic

Projects where we put these ideas to work, each with a live demo.

  • Tools Workshop — Quotely
    • Ruby on Rails
    • Hotwire (Turbo & Stimulus)
    • PostgreSQL

    SaaS Product Development

    Field-Service Quoting SaaS

    A Rails MVP taken from idea to paying subscribers in ten weeks, with Stripe billing and Hotwire interactivity.

  • Highway Road — Vantage Telematics
    • NestJS
    • TypeScript
    • Kafka

    Backend API Development

    Fleet Telematics API Platform on NestJS

    A NestJS API platform that ingests 40 million vehicle events a day and serves partners, dashboards and mobile apps from one documented interface.

  • Containers Bins — Stanmore Haulage
    • Azure Document Intelligence
    • Python
    • FastAPI

    Data Automation & OCR

    Proof-of-Delivery Capture with OCR for a Haulage Firm

    Photos of signed delivery notes turned into invoice-ready data automatically, cutting the gap between delivery and invoice from six days to one.

Keep Reading

  • GitHub Actions deploy workflow file in a code editor beside a delivery pipeline diagram running from build to Docker containers, edge and monitoring

    CI/CD for Small Teams: A Deployment Pipeline You Can Trust

    When deployments depend on one person running commands from memory, releases become rare and risky. Here is the simple CI/CD pipeline we set up for small teams: what it checks, how it deploys, how it rolls back and how to introduce it in stages.

  • Black-and-white close-up of a printed bar chart report beside a calculator and an open laptop

    Cutting Cloud Costs Without Slowing Your Site Down

    Most cloud waste has nothing to do with the servers your visitors rely on. Here is where a typical AWS, Azure or Google Cloud bill really comes from, and how to cut it while keeping the site as fast as before, or faster.

  • Cloud platform status dashboard on a laptop and phone showing deploy time, hosting cost, uptime and healthy services

    AWS, Azure or Google Cloud: Choosing a Provider for a Small Business Application

    AWS, Azure and Google Cloud can all run a typical business application. The choice usually comes down to the accounts you already have, what the application is built with, where data must live and who will look after it. Here is how we decide.

Let’s Connect

Let’s Build Something Amazing Together

Share your project details and our experts will get back to you within one business day with the best solution — free consultation, no obligation.