What do you mean by locally? If you want HTTPS automatically then the site must be publically available so that LetsEncrypt can verify the domain and grant the certificate. If that's not possible then you'll have to use the DNS challenge and setup a provider plugin.
It doesn't matter where the backend points and you can use it to serve a docker container if you want, but that's different from the the host/frontend address you use.