So here is the situation. I have setup a WordPress container. The yml file can be seen here
This run perfectly if I do
docker-compose up -d
What I do after installing WordPress is that I update the site URL to match the project name(using search/replace plugin)
And then I add it into my system’s hosts file like this
So this way the domain is set up for me locally.
Till this step all is working fine.
But now I want to setup another project e.g. project2.local
And I also want to keep project1.local running.
So I do docker-compose up -d from another folder using same yml file.
At this time, I get errors because the port I have used in project1 are already occupied.
Is there a solution for this so that I can run multiple containers for WordPress and run different project like
http://project1.local http://project2.local http://project3.local