How to configure a proxy for accessing the external network when deploying a local Docker Compose instance?

In an intranet environment, installing models and plugins results in errors. It’s necessary to configure a proxy to access the external network. Specifically, which container’s PROXY_HTTP and PROXY_HTTPS directives in docker-compose.yaml should be configured to access the external network?