From 6285abfc4e4519f375afa428a6031fe3511fe479 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sat, 3 Sep 2022 22:37:09 +0200 Subject: [PATCH] slightly increase docker build The restore command doesn't need the full source code, but just the .csproj files. (cherry picked from commit 391d02038547faf096cd53f383c4b57ba22f8ad5) --- Dockerfile | 7 +++++-- docker-compose.yml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23be278..1179791 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:6.0 as build WORKDIR /app/ -COPY ./Server/ ./Server/ -COPY ./Shared/ ./Shared/ +COPY ./Shared/Shared.csproj ./Shared/Shared.csproj +COPY ./Server/Server.csproj ./Server/Server.csproj ARG TARGETARCH @@ -16,6 +16,9 @@ RUN dotnet restore \ -r debian.11-`echo $TARGETARCH | sed 's@^amd@x@'` \ ; +COPY ./Shared/ ./Shared/ +COPY ./Server/ ./Server/ + # Build application binary RUN dotnet publish \ ./Server/Server.csproj \ diff --git a/docker-compose.yml b/docker-compose.yml index e794f60..6f13d07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: #build: . #user: 1000:1000 stdin_open: true + restart: unless-stopped ports: - 1027:1027 volumes: