From “Works on My Machine” to Isolated and Consistent Development with Docker Compose – Part One
The phrase “Works on My Machine” is familiar to every developer. The code successfully runs on one laptop but runs with unexpected errors on another laptop. And often, the problem is not with the code. The cause could be differences in the local environment, for example, different versions of Java, Node.js, PostgreSQL, MongoDB, Redis, or […]
Technologies
The phrase “Works on My Machine” is familiar to every developer. The code successfully runs on one laptop but runs with unexpected errors on another laptop. And often, the problem is not with the code. The cause could be differences in the local environment, for example, different versions of Java, Node.js, PostgreSQL, MongoDB, Redis, or other components, different ports, system variables, or personal customizations of the operating system.
The bigger the project, the more local customizations developers need. The bigger the project is, the more components developers usually need to configure locally. The more dependencies a project has, the more difficult it becomes to reproduce the same local environment on every developer’s machine.

Docker provides another approach: instead of configuring the environment on every laptop, necessary components can run in containers. A Docker image has everything needed to run a component in a specific environment. A container is a running instance of an image. For example, if a project needs PostgreSQL 16, developers don’t need to install PostgreSQL 16 on their operating systems. The team can specify the necessary PostgreSQL image and run it with Docker. The same applies to Redis, Kafka, and many other tools.
One more important advantage of local Docker containers is isolation.
Let’s look at a shared database. If a team uses one shared development database, any changes or experiments with the database could potentially affect other developers. When a developer is working on a new feature, he can create, update or delete test data, make changes to the table structure, create and test new migrations or intentionally create invalid data to test edge cases.
A local database running in Docker gives developers independence from other team members in such situations. For example, developers can insert thousands of test rows, remove some data, run a new migration, run and test several migrations in a row, test rollbacks, change the schema, drop and recreate the database. In many cases, if the DB gets corrupted, it makes sense to drop the database and recreate the environment from scratch. This makes the local environment a sandbox for developers: a place for experiments that don’t create any problems for the team.
Docker helps create a reproducible, isolated, and predictable local development environment. Developers can run the necessary components locally and rely less on shared infrastructure. As a result, this simplifies and speeds up the development process.
At Swan Software Solutions, we create reliable, scalable, and affordable solutions to help our clients reach their goals. To discover how our team can help your team with its technology needs, schedule a free assessment.