From a68ae630a9643125f577f0bd3b2e0c311ca661c6 Mon Sep 17 00:00:00 2001 From: Alejo Thomas Ortega Date: Wed, 10 Jan 2024 16:33:10 -0300 Subject: [PATCH] fix: scene-lod build --- Dockerfile | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10bdad66..d34b2207 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,3 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as dotnet-build - -# Set the working directory in the container -WORKDIR /app - -# Copy the .NET Core project file(s) into the container -COPY DCL_PiXYZ/ ./api -COPY nuget.config ./ -COPY local_packages/ ./local_packages - -WORKDIR /app/api - -# Restore dependencies and packages -RUN dotnet publish -c Release -r win10-x64 -o ./publish --self-contained true - -# Copy the rest of the code into the container -COPY DCL_PiXYZ/ ./ - # Use a basic Windows Server Core image FROM mcr.microsoft.com/windows/servercore:ltsc2019 as base @@ -39,14 +21,17 @@ FROM base as scene-lod-build WORKDIR /scene-lod +COPY scene-lod-entities-manifest-builder /scene-lod +RUN if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules } + +# Clear npm cache +RUN npm cache clean --force + COPY scene-lod-entities-manifest-builder/package.json /scene-lod COPY scene-lod-entities-manifest-builder/package-lock.json /scene-lod -RUN npm ci -COPY scene-lod-entities-manifest-builder /scene-lod -RUN npm run build - -RUN npm ci --only=production +# Try running npm ci with more verbose logging +RUN npm ci --only=production --verbose # Consumer Server Build FROM base as consumer-server-build @@ -62,6 +47,24 @@ RUN yarn build RUN yarn install --frozen-lockfile +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as dotnet-build + +# Set the working directory in the container +WORKDIR /app + +# Copy the .NET Core project file(s) into the container +COPY DCL_PiXYZ/ ./api +COPY nuget.config ./ +COPY local_packages/ ./local_packages + +WORKDIR /app/api + +# Restore dependencies and packages +RUN dotnet publish -c Release -r win10-x64 -o ./publish --self-contained true + +# Copy the rest of the code into the container +COPY DCL_PiXYZ/ ./ + # FROM mcr.microsoft.com/windows/servercore as windows-runtime FROM mcr.microsoft.com/windows/servercore:ltsc2019