fix: Ripristina nomi directory originali per rispettare riferimenti .csproj
This commit is contained in:
+17
-17
@@ -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
|
||||||
|
|
||||||
# Copia i file di progetto e ripristina le dipendenze
|
# Copia i file di progetto e ripristina le dipendenze con nomi originali
|
||||||
COPY ["Data_Coupler/Data_Coupler.csproj", "DC/"]
|
COPY ["Data_Coupler/Data_Coupler.csproj", "Data_Coupler/"]
|
||||||
COPY ["DataConnection/DataConnection.csproj", "DCon/"]
|
COPY ["DataConnection/DataConnection.csproj", "DataConnection/"]
|
||||||
COPY ["CredentialManager/CredentialManager.csproj", "CM/"]
|
COPY ["CredentialManager/CredentialManager.csproj", "CredentialManager/"]
|
||||||
COPY ["Components/Components.csproj", "Comp/"]
|
COPY ["Components/Components.csproj", "Components/"]
|
||||||
COPY ["nuget.config", "./"]
|
COPY ["nuget.config", "./"]
|
||||||
|
|
||||||
# Ripristina le dipendenze per tutti i progetti con path corti
|
# Ripristina le dipendenze per tutti i progetti con package cache ultra-corto
|
||||||
RUN dotnet restore "DC/Data_Coupler.csproj" --disable-parallel --packages /p
|
RUN dotnet restore "Data_Coupler/Data_Coupler.csproj" --disable-parallel --packages /p
|
||||||
|
|
||||||
# Copia tutto il codice sorgente con struttura abbreviata
|
# Copia tutto il codice sorgente
|
||||||
COPY ["Data_Coupler/", "DC/"]
|
COPY ["Data_Coupler/", "Data_Coupler/"]
|
||||||
COPY ["DataConnection/", "DCon/"]
|
COPY ["DataConnection/", "DataConnection/"]
|
||||||
COPY ["CredentialManager/", "CM/"]
|
COPY ["CredentialManager/", "CredentialManager/"]
|
||||||
COPY ["Components/", "Comp/"]
|
COPY ["Components/", "Components/"]
|
||||||
|
|
||||||
# Build del progetto principale
|
# Build del progetto principale con output path corto
|
||||||
WORKDIR "/s/DC"
|
WORKDIR "/s/Data_Coupler"
|
||||||
RUN dotnet build "Data_Coupler.csproj" -c Release -o /a/b --no-restore
|
RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --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 /a/p --no-restore /p:UseAppHost=false
|
RUN dotnet publish "Data_Coupler.csproj" -c Release -o /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 /a/p .
|
COPY --from=publish /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