I am currently operating a web service based on Docker, running on a Linux host. My service is accessible to the internet through a public IP address. However, it currently uses insecure HTTP. I would like to know how I can apply a certificate to secure my public IP address along with the assigned port number.
For Let's Encrypt you'd indeed need to use a hostname, e.g. your own domain name or a subdomain of a free service, e.g. a DDNS service or e.g. services like Freenom (which isn't such a good choice performance wise) or e.g. https://eu.org/
That said, ZeroSSL offers (free, but limited) certificates for IP addresses, but not through their ACME API.
Certificates can be used on any port number - so, that's not something it "controls".
The normal/simplest way of securing an IP with a certificate entails using an FQDN that you control.
Do you want to securely access the service at that IP by a name or strictly by its' IP?