28 lines
998 B
Docker
28 lines
998 B
Docker
|
|
# Use the official .NET 10 ASP.NET runtime
|
||
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
||
|
|
WORKDIR /app
|
||
|
|
EXPOSE 8080
|
||
|
|
|
||
|
|
# Use the .NET 10 SDK for building
|
||
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||
|
|
WORKDIR /src
|
||
|
|
|
||
|
|
# COPY both project files to restore dependencies
|
||
|
|
COPY ["paperless-ngx-export.service/paperless-ngx-export.service.csproj", "paperless-ngx-export.service/"]
|
||
|
|
COPY ["paperless-ngx-export/paperless-ngx-export.csproj", "paperless-ngx-export/"]
|
||
|
|
|
||
|
|
# Restore based on the main project
|
||
|
|
RUN dotnet restore "paperless-ngx-export.service/paperless-ngx-export.service.csproj"
|
||
|
|
|
||
|
|
# Copy everything else and build
|
||
|
|
COPY . .
|
||
|
|
WORKDIR "/src/paperless-ngx-export.service"
|
||
|
|
RUN dotnet build "paperless-ngx-export.service.csproj" -c Release -o /app/build
|
||
|
|
|
||
|
|
FROM build AS publish
|
||
|
|
RUN dotnet publish "paperless-ngx-export.service.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||
|
|
|
||
|
|
FROM base AS final
|
||
|
|
WORKDIR /app
|
||
|
|
COPY --from=publish /app/publish .
|
||
|
|
ENTRYPOINT ["dotnet", "paperless-ngx-export.service.dll"]
|