How to handle multiple projects with same server requirements in docker?

Hi I am new to docker the only time i’ve been using docker is with Laravel Sail that comes with ready to use docker configuration.

I love the idea of using docker containers but have couple of doubts that i’m not able find the solution of, online. Please i’ll really appreciate if someone will explain or provide their guidance on this topic

My requirements are

  1. Earlier i used to use xampp lets say xyz version that comes with xyz version of apache, mysql mariadb etc …which contains lets say 4 of my projects.
  2. then i moved to some latest version xampp abc latest php , myql etc etc that again have 3 of my some project that uses latest tech version.
  3. Now this kept on going NOW I HAVE SETS OF PROJECTS THAT USES SAME CONFIGURATIONS OR IN OTHER WORDS SHARES THE SAME SERVER REQUIRENMENTS.

As docker serves to this sole purpose i just dont know how to implement it.
if anyone can explain in simple language that would be really helpful.
Thanks in advance

You probably want to start from the beginning as you understood that this is what Docker is for, but this is exactly why all of the basic tutorials should explain the solution. I share my template of recommended links below, but in short: you use the same docker image and run multiple containers from that image. And you use a reverse proxy like Nginx Proxy or Traefik to be able to use a single port for multiple services instead of using virtual hosts. Of course you could use virtual hosts, but that is not what we do in containers. My tutorials linked below use Nginx Proxy but I use Traefik in production.

Recommended links to learn the basics and concepts: