Since this is cloudflare you want to use the cloudflare pattern and pass through the header.
https://github.com/discourse/discourse_docker/blob/master/templates/cloudflare.template.yml#L16
So you want to pass CF-Connecting-IP
through apache and then to mix in our cloudflare template.