net core project. I have successfully build the project. Below is my dockerfile.
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 4040
EXPOSE 5050
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["MWS.AspNetCoreApis/MWS.AspNetCoreApis.csproj", "MWS.AspNetCoreApis/"]
RUN dotnet restore "MWS.AspNetCoreApis/MWS.AspNetCoreApis.csproj"
COPY . .
WORKDIR "/src/MWS.AspNetCoreApis"
RUN dotnet build "MWS.AspNetCoreApis.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "MWS.AspNetCoreApis.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
CMD tail -f /dev/null
ENTRYPOINT ["dotnet", "MWS.AspNetCoreApis.dll"]
I build my application as docker build -t locationservices . Here I build my image. Then when I run my image using docker run -d locationservices it gives some long id. When I try to hit http://localhost:40/swagger/index.html or http://localhost:5050/swagger/index.html my web page doesnt open.
When I run >docker run -it locationservices I get below message.
Hosting environment: Production Content root path: /app Now listening on: http://[::]:80 Application started. Press Ctrl+C to shut down.
But I am not able to hit my application using any of the below urls
http://localhost:5050/swagger/index.html
http://localhost:4040/swagger/index.html
http://localhost:80/swagger/index.html
can someone help me to figure out the issue. Any help would be appreciated. Thanks