init
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["src/Core/Core.csproj", "src/Core/"]
|
||||
COPY ["src/Interface/Interface.csproj", "src/Interface/"]
|
||||
COPY ["src/Service/Service.csproj", "src/Service/"]
|
||||
COPY ["src/WebApi/WebApi.csproj", "src/WebApi/"]
|
||||
RUN dotnet restore "src/WebApi/WebApi.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/src/WebApi"
|
||||
RUN dotnet build "WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "WebApi.dll"]
|
||||
Reference in New Issue
Block a user