SOMUCHDOG
SOMUCHDOG
CC#
Created by SOMUCHDOG on 7/11/2024 in #help
✅ .Net 8 WebApi not responding from Docker container
I am running a default .Net 8 webapi project that I created via the dotnet CLI
dotnet new webapi -n dotnetapi
dotnet new webapi -n dotnetapi
The project builds and runs locally, I am able to get a response. Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet build -c Release -o /app/build

FROM build AS publish
RUN dotnet publish -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DotNetApi.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet build -c Release -o /app/build

FROM build AS publish
RUN dotnet publish -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DotNetApi.dll"]
I build the image and run it
docker run -p 5154:80 dotnet-api
docker run -p 5154:80 dotnet-api
Cannot get a response from the api
curl http://localhost:5154/weatherforecast
curl http://localhost:5154/weatherforecast
Any help appreciated!
14 replies
CC#
Created by SOMUCHDOG on 6/19/2024 in #help
How do I implement the Chrome API Sidepanel with a Blazor browser extension?
1 replies
CC#
Created by SOMUCHDOG on 6/1/2024 in #help
Identifying the Framework in a .csproj file
When you are trying to identify the framework from a csproj file, sometimes there are multiple versions of frameworks mentioned. i.e. TargetFramework 2.0 then Some bootstrapper package will include .Net Framework 3.5 Which one is it?
5 replies
CC#
Created by SOMUCHDOG on 5/31/2024 in #help
How do I confirm the framework of a dotnet application from the code?
I'd like to know where I can consistantly identify the framework of the project.
3 replies
CC#
Created by SOMUCHDOG on 5/13/2024 in #help
What C# certifications are worth getting?
I'm looking for certs in C# but I don't know which one's are respected.
8 replies