build: 🔨 optimize published artifact only in prod

This commit is contained in:
Collin M. Barrett 2020-08-29 11:16:32 -05:00
parent 6a7f669c0b
commit bd2b09714b
2 changed files with 1 additions and 3 deletions

View file

@ -24,7 +24,7 @@ COPY directory/src/FilterLists.Directory.Infrastructure.Migrations/. FilterLists
COPY directory/src/FilterLists.Directory.Application/. FilterLists.Directory.Application/
WORKDIR /src/FilterLists.Directory.Api
COPY directory/src/FilterLists.Directory.Api/. .
RUN dotnet publish --no-restore -c Release -o /app/publish -r linux-musl-x64 -p:PublishSingleFile=true
RUN dotnet publish -c Release --no-restore -o /app/publish -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-musl-x64
# package final
FROM base AS final

View file

@ -4,8 +4,6 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<RuntimeIdentifiers>linux-musl-x64;win10-x64</RuntimeIdentifiers>
</PropertyGroup>