starting by saying I am totally new to Docker and I am not yet familiarized with the Docker ecosystem.
What I try to perform is to create a
docker-composer.yml to be used in my local dev environment across my projects.
I already use the wp-local-docker for my WordPress projects, but I also have old projects that come with different requirements and for that reason, I did my own
docker-compose.yml. The code of my own
docker-compose.yml is the following:
- subnet: 192.168.50.0/24
The reason I have installed the network is that when I try to access the database server, I get an error related to the network.
After a long time of research, I found that when I use the
database service I get back the error. If you try it, you will find that when you try to access the
phpmyadmin you will get the same error.
Again, after a long time of research, I found that I can use the
volumes for the
database if I set up a network.
Now when I did the first run this worked like a charm. In the test folder, I had the database files in my host folder under the path
Then I stopped the docker compose using the command
docker-compose stop and then I moved to another folder, in which I copied the
docker-compose.yml and then I run the
Unfortunately this time I got the following error:
Creating network "corfurealestatedch_app_net" with driver "bridge"
ERROR: cannot create network 791b388ece09120f1138d48427969c23ded22c6fc73699b7f8c2c8e195b59586 (br-791b388ece09): conflicts with network a675c47764eba17e3338860f56512067df580cef31415906ec57fa3b64f3cdab (br-a675c47764eb): networks have overlapping IPv4
So the question is if I can set up the
docker-compose.yml in a such a way that it can be used across my local projects without conflicting with the other containers IPs.
I know, of course I can have a different IP range / sub net for each project, but I am thinking that this could become a mess in a sort period of time.
Any idea on how I can fix that ?
Thank you in advence!