From a5cf572c055bbf6bb288a1129d643ecea4abd31b Mon Sep 17 00:00:00 2001 From: femsci Date: Sun, 1 Oct 2023 12:03:11 +0200 Subject: [PATCH] Dockerfile --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8a3e62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build + +WORKDIR /source + +COPY Interlinked.sln ./ + +COPY src/Interlinked.Core/*.csproj src/Interlinked.Core/ +COPY src/Interlinked.Shared/*.csproj src/Interlinked.Shared/ +COPY src/Interlinked.User/*.csproj src/Interlinked.User/ +copy test/Interlinked.Test/*.csproj test/Interlinked.Test/ + +RUN dotnet restore + +COPY . . + +RUN dotnet publish ./src/Interlinked.User -c Release -o /build/interlinked + +FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS runtime + + +COPY --from=build /build/interlinked /srv/interlinked + +VOLUME [ "/data", "/srv/log" ] + +WORKDIR /srv/interlinked + +ENV ASPNETCORE_ENVIRONMENT=Production + +# Net + +EXPOSE 80/tcp + +STOPSIGNAL SIGTERM + +ENTRYPOINT [ "dotnet", "/srv/interlinked/Interlinked.User.dll" ]