Add docker support

This commit is contained in:
Julian
2023-10-30 16:39:11 +01:00
parent 136ce48385
commit d58f874162
8 changed files with 178 additions and 22 deletions

View File

@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG configuration=Release
WORKDIR /src
COPY ["GerbilManagerWebAPI/GerbilManagerWebAPI.csproj", "GerbilManagerWebAPI/"]
RUN dotnet restore "GerbilManagerWebAPI/GerbilManagerWebAPI.csproj"
COPY . .
WORKDIR "/src/GerbilManagerWebAPI"
ARG configuration=Release
RUN dotnet publish "GerbilManagerWebAPI.csproj" -c $configuration -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "GerbilManagerWebAPI.dll"]