Your Caddyfile doesn’t make much sense – there’s no use to use both file_server and reverse_proxy at the same time, without request matchers. And you don’t need any of the header_up lines, they’re actually harmful in many cases. You can simplify it to this:
That said, the reason you’re seeing Docker’s IP is because Docker often puts a userland proxy in front of containers, which transforms the TCP packets before they reach Caddy, making it look like the requests came from Docker itself. You can turn this off in Docker’s settings.
Next time, please fill out the help topic template. There’s bits missing from your post which make it confusing, e.g. how are you running the Caddy container, which version of Caddy are you running, etc.
saeb@mobin-13991227 ~> cat /etc/caddy/Caddyfile
# The Caddyfile is an easy way to configure your Caddy web server.
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
root * /usr/share/caddy