From f25c9250ec109485e05f366f32fb18f5f9c2b309 Mon Sep 17 00:00:00 2001 From: Daan Boerlage Date: Fri, 19 Mar 2021 01:10:22 +0100 Subject: [PATCH] Switch to an alpine container and single file, self-contained deployments --- .gitlab-ci.yml | 2 +- Dockerfile | 2 +- src/Bot/Bot.csproj | 2 +- src/Core/Core.csproj | 1 + src/Web/Web.csproj | 1 + tests/Tests.csproj | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 967def1..f92ba14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ Build: script: - dotnet restore - dotnet test tests - - dotnet publish --version-suffix "$VERSION" -r linux-x64 -c Release -o ./app ./src/Bot/ + - dotnet publish --version-suffix "$VERSION" -r linux-musl-x64 -p:PublishSingleFile=true --self-contained true -c Release -o ./app ./src/Bot/ Package: stage: docker diff --git a/Dockerfile b/Dockerfile index 39529ff..6e81339 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 +FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine COPY ./app /app/ diff --git a/src/Bot/Bot.csproj b/src/Bot/Bot.csproj index 86ab9a3..9312ac1 100644 --- a/src/Bot/Bot.csproj +++ b/src/Bot/Bot.csproj @@ -2,7 +2,7 @@ Exe net6.0 - win-x64;linux-x64 + win10-x64;linux-x64;linux-musl-x64 derp.ico $(VersionSuffix) Geekbot.Bot diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 474478e..17b4a26 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -2,6 +2,7 @@ net6.0 + win10-x64;linux-x64;linux-musl-x64 $(VersionSuffix) $(VersionSuffix) 0.0.0-DEV diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj index 744cadf..d57c63c 100644 --- a/src/Web/Web.csproj +++ b/src/Web/Web.csproj @@ -2,6 +2,7 @@ net6.0 + win10-x64;linux-x64;linux-musl-x64 $(VersionSuffix) $(VersionSuffix) 0.0.0-DEV diff --git a/tests/Tests.csproj b/tests/Tests.csproj index 6b9b84f..4823e0b 100644 --- a/tests/Tests.csproj +++ b/tests/Tests.csproj @@ -1,6 +1,7 @@  net6.0 + win10-x64;linux-x64;linux-musl-x64 false NU1701 xUnit1026