We have an automated system that sets up new sites on our server. Up until now in the code I have been running a certbot command to get a new certificate for the site. This process needs to change because I'm moving our application server into a docker container.
Certbot is still on the host machine, but I can't trigger it from the container.
Inside the container I have access to the certificates folder. What I'm wondering is if I manually create a file in the renewal folder, will certbot setup a certificate for the new site the next time it runs.
I'm using certbot with the certonly command so it doesn't need to do anything with web server config or anything like that, just get the certificate.
I'd say yes, but from that point onwards you own any problems with incompatible config file syntax that may develop in the future.
Really though the only way you can know if this is going to work is to try it yourself.
[Edit: if it's of interest Certify Management Hub is a new thing we are building at Certify The Web that might be useful for what you are trying to do, it will have an API, although the complexity of using that will vary depending on if you are using http domain validation or DNS domain validation: https://hub.docker.com/repository/docker/certifytheweb/management-hub/general - it's not officially released yet, it is very much pre-alpha, and may be much more than you need]
I also wouldn't recommend trying to manipulate certbot's config structure.
You probably want to run certbot in its own container in such a way that it persists the /etc/letsencrypt directory structure (and either shares with the container running the application server, or some kind of post-hook copies the certificates wherever you need them to).
Another option is to find a different ACME client more conducive to your workflow; certbot is designed around the "I have a single server and want to enable TLS on it" but once you get beyond that you may want to look for alternatives.