The Swarm deployment uses docker-compose.swarm.portainer.yml, not the root docker-compose.yml. Add NEXT_PUBLIC_APP_URL, NEXT_PUBLIC_API_URL, and TRUSTED_ORIGINS to the API service environment. Also log trusted origins at startup for easier CORS debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>