From 7b6ba4191c5acdb4d762ec7142adfe9d7943ab95 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 2 Jan 2021 12:49:22 -0600 Subject: tweak build stuff --- Dockerfile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index b910103e..6b621ad3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,27 @@ FROM node:lts-alpine3.12 AS web WORKDIR /web/ COPY src/web . -RUN npm install +RUN npm ci +RUN npm run test-unattended RUN npm run build FROM mcr.microsoft.com/dotnet/sdk:5.0 as build WORKDIR /slskd/ COPY src/slskd . COPY --from=web web/build wwwroot -RUN dotnet publish --configuration Release -p:PublishSingleFile=true -p:ReadyToRun=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained --runtime linux-musl-x64 +RUN dotnet restore +RUN dotnet build --no-restore --configuration Release +RUN dotnet test --no-build --verbosity minimal --blame + +FROM mcr.microsoft.com/dotnet/sdk:5.0 as publish +WORKDIR /slskd/ +COPY src/slskd . +COPY --from=web web/build wwwroot +RUN dotnet publish --configuration Release -p:PublishSingleFile=true -p:ReadyToRun=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true -p:CopyOutputSymbolsToPublishDirectory=false --self-contained --runtime linux-musl-x64 --output dist FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-alpine WORKDIR /slskd/ -COPY --from=build slskd/bin/Release/net5.0/linux-musl-x64/publish . +COPY --from=publish slskd/dist . RUN mkdir /var/slsk RUN mkdir /var/slsk/shared -- cgit v1.2.3