This is an all-in-one docker compose file to setup a nginx proxy server with TLS using certbot. This configuration tries to renew the certificates and reloads the nginx configuration every 24 hours. You just have to create a .env file next to the compose file with the server name and an email for the ACME protocol, like this:
SERVER_NAME=...
EMAIL=...There's an external docker network called nginx-network in the compose configuration, that you can use to have access to other services running in the same network. You have to create it before running docker compose up: