From c3503c4a6f08ad27e2cbb947aa406749f4515452 Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Fri, 16 Jan 2026 14:46:39 +0100 Subject: [PATCH] fix: Risolve limitazioni path lunghi Windows rimuovendo PowerShell e abbreviando percorsi --- Dockerfile.windows | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 134e0a7..f9d5499 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -5,29 +5,29 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-ltsc2022 AS build WORKDIR /s -# Abilita long paths per Windows -RUN powershell -Command "New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 -PropertyType DWORD -Force; exit 0" - # Copia i file di progetto e ripristina le dipendenze -COPY ["Data_Coupler/Data_Coupler.csproj", "Data_Coupler/"] -COPY ["DataConnection/DataConnection.csproj", "DataConnection/"] -COPY ["CredentialManager/CredentialManager.csproj", "CredentialManager/"] -COPY ["Components/Components.csproj", "Components/"] +COPY ["Data_Coupler/Data_Coupler.csproj", "DC/"] +COPY ["DataConnection/DataConnection.csproj", "DCon/"] +COPY ["CredentialManager/CredentialManager.csproj", "CM/"] +COPY ["Components/Components.csproj", "Comp/"] COPY ["nuget.config", "./"] -# Ripristina le dipendenze per tutti i progetti con path più corti -RUN dotnet restore "Data_Coupler/Data_Coupler.csproj" --disable-parallel +# Ripristina le dipendenze per tutti i progetti con path corti +RUN dotnet restore "DC/Data_Coupler.csproj" --disable-parallel --packages /p -# Copia tutto il codice sorgente -COPY . . +# Copia tutto il codice sorgente con struttura abbreviata +COPY ["Data_Coupler/", "DC/"] +COPY ["DataConnection/", "DCon/"] +COPY ["CredentialManager/", "CM/"] +COPY ["Components/", "Comp/"] # Build del progetto principale -WORKDIR "/s/Data_Coupler" -RUN dotnet build "Data_Coupler.csproj" -c Release -o /app/build --no-restore +WORKDIR "/s/DC" +RUN dotnet build "Data_Coupler.csproj" -c Release -o /a/b --no-restore # Stage 2: Publish FROM build AS publish -RUN dotnet publish "Data_Coupler.csproj" -c Release -o /app/publish --no-restore /p:UseAppHost=false +RUN dotnet publish "Data_Coupler.csproj" -c Release -o /a/p --no-restore /p:UseAppHost=false # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final @@ -37,7 +37,7 @@ WORKDIR /app RUN mkdir C:\ProgramData\Data_Coupler # Copia i file pubblicati -COPY --from=publish /app/publish . +COPY --from=publish /a/p . # Configura le variabili d'ambiente ENV ASPNETCORE_URLS=http://+:7550