diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..8d4a6c08a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +bin +obj \ No newline at end of file diff --git a/samples/EchoServer/Dockerfile b/samples/EchoServer/Dockerfile new file mode 100644 index 000000000..f60a992ac --- /dev/null +++ b/samples/EchoServer/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +WORKDIR /app + +COPY . ./ +WORKDIR /app/samples/EchoServer + +RUN dotnet publish -c Release -o /app/out -f net8.0 + + +# Build runtime image +FROM mcr.microsoft.com/dotnet/aspnet:8.0 + +WORKDIR /app +COPY --from=build-env /app/out . + +ENV ASPNETCORE_URLS http://*:5000 +ENTRYPOINT ["dotnet", "EchoServer.dll"] \ No newline at end of file