Skip to content

A sample project that shows how to run an ASP.NET Core web application on a custom port using Docker.

License

Notifications You must be signed in to change notification settings

waliulrayhan/Asp.Net-Core-Custom-Port-Number-Docker

Repository files navigation

Asp.Net-Core-Custom-Port-Number-Docker

A sample project that shows how to run an ASP.NET Core web application on a custom port using Docker.

Prerequisites

Setup Instructions

  1. Clone this repository
  2. Open the solution in Visual Studio Code or your preferred IDE
  3. Modify the docker-compose.override.yml file and remove the ASPNETCORE_HTTPS_PORTS environment variable
  4. Modify the ports section and specify your custom port number, for example 8081:8080
  5. Modify the WebApplication1/Properties/launchSettings.json file and remove the ASPNETCORE_HTTPS_PORTS environment variable
    Modify the ASPNETCORE_HTTP_PORTS environment variable and set it to your custom port number, for example 8081
  6. Ensure that the port numbers specified in docker-compose.override.yml and launchSettings.json match.
  7. Right-click on the docker-compose project and select Build
  8. Right-click on the docker-compose project and select Run
  9. 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.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A sample project that shows how to run an ASP.NET Core web application on a custom port using Docker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published