'[VS2019/2022]How exactly {ServicePort} in the Docker-Compose project works and can be configured?

How to use other service in the Docker-Compose to be paired with the {ServicePort}? I only want a web-server(like Nginx) service to be exposed. How can I point {ServicePort} to the web-server service? Thanks!



Solution 1:[1]

In your project Properties/launchSettings.json, to use port 1234, if you specify sslport it will become the value of {ServicePort}

"Docker": { "commandName": "Docker", "launchBrowser": true, "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", "sslPort": 1234, "httpPort": 1235, "useSSL": true }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pierre Goch