Personally, I followed the instructions to install Caddy with Docker Compose in the Nextcloud AIO reverse proxy documentation. Regarding building custom images, there are the instructions to build a custom Caddy image in a Dockerfile in the Docker Hub page.