fix: Risolve limitazioni path lunghi Windows rimuovendo PowerShell e abbreviando percorsi
This commit is contained in:
+15
-15
@@ -5,29 +5,29 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-ltsc2022 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-ltsc2022 AS build
|
||||||
WORKDIR /s
|
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
|
# Copia i file di progetto e ripristina le dipendenze
|
||||||
COPY ["Data_Coupler/Data_Coupler.csproj", "Data_Coupler/"]
|
COPY ["Data_Coupler/Data_Coupler.csproj", "DC/"]
|
||||||
COPY ["DataConnection/DataConnection.csproj", "DataConnection/"]
|
COPY ["DataConnection/DataConnection.csproj", "DCon/"]
|
||||||
COPY ["CredentialManager/CredentialManager.csproj", "CredentialManager/"]
|
COPY ["CredentialManager/CredentialManager.csproj", "CM/"]
|
||||||
COPY ["Components/Components.csproj", "Components/"]
|
COPY ["Components/Components.csproj", "Comp/"]
|
||||||
COPY ["nuget.config", "./"]
|
COPY ["nuget.config", "./"]
|
||||||
|
|
||||||
# Ripristina le dipendenze per tutti i progetti con path più corti
|
# Ripristina le dipendenze per tutti i progetti con path corti
|
||||||
RUN dotnet restore "Data_Coupler/Data_Coupler.csproj" --disable-parallel
|
RUN dotnet restore "DC/Data_Coupler.csproj" --disable-parallel --packages /p
|
||||||
|
|
||||||
# Copia tutto il codice sorgente
|
# Copia tutto il codice sorgente con struttura abbreviata
|
||||||
COPY . .
|
COPY ["Data_Coupler/", "DC/"]
|
||||||
|
COPY ["DataConnection/", "DCon/"]
|
||||||
|
COPY ["CredentialManager/", "CM/"]
|
||||||
|
COPY ["Components/", "Comp/"]
|
||||||
|
|
||||||
# Build del progetto principale
|
# Build del progetto principale
|
||||||
WORKDIR "/s/Data_Coupler"
|
WORKDIR "/s/DC"
|
||||||
RUN dotnet build "Data_Coupler.csproj" -c Release -o /app/build --no-restore
|
RUN dotnet build "Data_Coupler.csproj" -c Release -o /a/b --no-restore
|
||||||
|
|
||||||
# Stage 2: Publish
|
# Stage 2: Publish
|
||||||
FROM build AS 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
|
# Stage 3: Runtime
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final
|
||||||
@@ -37,7 +37,7 @@ WORKDIR /app
|
|||||||
RUN mkdir C:\ProgramData\Data_Coupler
|
RUN mkdir C:\ProgramData\Data_Coupler
|
||||||
|
|
||||||
# Copia i file pubblicati
|
# Copia i file pubblicati
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /a/p .
|
||||||
|
|
||||||
# Configura le variabili d'ambiente
|
# Configura le variabili d'ambiente
|
||||||
ENV ASPNETCORE_URLS=http://+:7550
|
ENV ASPNETCORE_URLS=http://+:7550
|
||||||
|
|||||||
Reference in New Issue
Block a user