Trouble using ipify API

Hello,
I am using Ipify API to see IP adresses in my project. However, when I run this code:

<?php
    $ip = file_get_contents('https://api.ipify.org');
    echo "My public IP address is: " . $ip;
?>

I get the project container’s IP. What am I doing wrong?

Nothing wrong, because the code is running on the container so it would show the container ip

If you want the IP address that the request came from, take a look at the first part of the x-forwarded-for header whenever a request is made.