See Keep Caddy Running — Caddy Documentation, it explains how to set environment variables via systemd config overrides.