Every time I used MySQL in Docker it was really easy. Setup the container, use the documented env vars. Never had to adapt a MySQL configuration file.
Attach it to the same Docker network, as the clients that should connect to it. Use the compose service name to connect to the database, not localhost/127.0.0.1.
@bluepuma77 Great this made it work for me. the compose service name did not work for me. But the ip which it has was the one to use. So now I have A fully working CMS serving to the www, from its own domain, using mysql8 in the docker container and php8.* from the server. It goes along with other domains, using different php, and mysql 5.7 version. Now let find out how this will work out over time
Everything you bind as volume must be underneath /var/docker. Its the host folder we mapped into Portainer, so it can verify the existence of directories and files before deployment. You can choose whatever host path you want, you just need to make sure to map it into Portainer using the same path as well. Seems like this points still didn’t sink in…
Can be done, but is more complicated ← not recommended
Service discovery is only available for containers in the same user defined container network. Not on the host. The host needs to use <host-ip>:<published-host-port>. The host-ip can be any ip your host has, including localhost, unless you bind your published ports to a specific ip, like shown above.
I feel you would strongly benefit from knowing more about docker’s concept and how things are done in docker. Here are some recommended links to learn the basics and concepts:
Thanks. I will look into the info you shared. I already have a much better understanding of how things work with all the help here. I’m sure things can be improved but for now this is already great.