top of page

A real example from my experience using docker!



Almost all the projects I work on daily are contained in production.

Others, however, are also contained in the development environment.


Some time ago, we had to develop a new project in the space of a few months, and we found ourselves facing these points:

  • More than 3 junior people in the team, 2 middle.

  • Stack: Laravel (PHP 8.0), ReactJS 18, PostgreSQL, AWS S3 and SQS services.

  • The staging server with PHP 7.4.

  • Two production servers, where the project would be launched, have PHP 7.4 and one PHP 8.0.


Under these conditions, I think we didn’t have much choice:

Docker had to be used.

Let’s analyse the points together:


1️⃣ — Long setup and different environments.

To prepare the setup on more than 8 PCs, including the laptops which the team used to work remotely, it would have taken a long time.

Furthermore, the work PC environment tends to change over time.

So it was better to prepare the project environment immediately using Docker.

To be honest, preparing the environment for a Laravel, ReactJS and PostgreSQL project would not have been impossible, but the point is that all PCs had different configurations, operating systems and “different stories”.

For example, someone might need to upgrade PHP, while someone else needs to downgrade. This could have compromised the functioning of other projects on their PCs.


2️⃣ — Different tech stacks

As you can see, there are different tech stacks to use for the new project to function. So, it was convenient for everyone to have a Docker setup where, with just two commands, we could build and launch the entire environment ready to be used.

In the Docker configuration, in addition to the PostgreSQL image, we also configured the pgAdmin 4 image, a tool with a user interface for managing PostgreSQL. Convenient, right?


3️⃣ — Staging server

For us, the staging server is the testing and quality assurance machine, before preparing the project for pre-production or production.

On this machine there are other projects developed with PHP 7.4 and upgrading is not an option.

Adding another server is not necessary for two reasons:

— Keep costs low.— The staging server has sufficient resources.


4️⃣ — Production server

Same problem as point 3, so we remain in favour of using Docker.

Conclusion

Using docker in projects nowadays have become a standard. But, not is always the case to use docker. Brainstorm all your variables before use docker. In some cases, you can just add more complexity at your architecture using docker.

cipiklevis@gmail.com

+355674907376

  • White LinkedIn Icon
  • White Twitter Icon

©2024 by Klevis Cipi.

Albania, Tirane

bottom of page