NET 6 Dockerfile Timeout Error

Hi, i’m running a very basic net 6 Docker app. This is the Dockerfile

FROM AS base

RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev


FROM AS build


COPY ["myapp/myapp.csproj", "myapp/"]

RUN dotnet restore "myapp/myapp.csproj"

COPY . .

WORKDIR "/src/myapp"

RUN dotnet build "myapp.csproj" -c Release -o /app/build

FROM build AS publish

RUN dotnet publish "myapp.csproj" -c Release -o /app/publish

FROM base AS final


COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "myapp.dll"]

The logs show the app building and running properly

And there’s an env variable PORT set up matching the app port of the kestrel server

However, the deploy eventually fails with a timed out error and accessing the app URL returns a 502 response.

Any ideas? Thanks.

Hi Marcos,

Thanks for reaching out.

There seems to be a function ListenLocalhost in your screenshot. You’d need to be listening on all interfaces ( and not localhost ( Maybe that’s the issue?


Okay, expanding the webhost config with a wildcard made it work. Thanks for pointing me in the right direction!

For anyone facing the same issue:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.