Connect docker compose nginx+php with local database

how to connect nginx+php i was create docker compose with my server database mysql which is on another server, but is still in one network, more or less a simple topology like this:

and my docker compose yaml : Screenshot by Lightshot

Please help me, thanks

You need to set the MySQL IP as target in the PHP application. Not sure what the issue is.

How can i do that? is declare to docker compose or how? thanks

For both containers to be able to see each other, they must be on the same Docker network. Use these commands to connect both containers.

  1. Create a new network
    docker network create {network_name}

  2. Assign a container to a network
    docker network connect {network_name} {container}

Sorry Emmanuel, FYI: according to the picture I captured above, between the Docker server and the MySQL server, each is on a different physical server, not in the same physical server or the same container, but these two physical servers are still on the same network.
Thanks