3 ms·Docker service automatically resolve other service‘s IP and update it in .env1 points by inex 4y agoinex 4y agoBecause mysqli in PHP does not work with Hostnames – only IPs.gigatexal 4y agoAhh! I came here to say if you name your services then you can just use that name. Ex: Docker run -d … -rm —name=db Then connect to it using some client or something else passing db as the hostname