A sample project that shows how to run an ASP.NET Core web application on a custom port using Docker.
- Clone this repository
- Open the solution in Visual Studio Code or your preferred IDE
- Modify the
docker-compose.override.yml
file and remove theASPNETCORE_HTTPS_PORTS
environment variable - Modify the
ports
section and specify your custom port number, for example8081:8080
- Modify the
WebApplication1/Properties/launchSettings.json
file and remove theASPNETCORE_HTTPS_PORTS
environment variable
Modify theASPNETCORE_HTTP_PORTS
environment variable and set it to your custom port number, for example8081
- Ensure that the port numbers specified in
docker-compose.override.yml
andlaunchSettings.json
match. - Right-click on the
docker-compose
project and selectBuild
- Right-click on the
docker-compose
project and selectRun
- Open your browser and navigate to
http://localhost:8081
(or your custom port number)
Once the configurations are updated, build and run your ASP.NET Core application using Docker. Your application will now be accessible through the specified custom port number.
This project is licensed under the MIT License - see the LICENSE file for details