From 90a54b89155f80c28813fe3068612cff94792f28 Mon Sep 17 00:00:00 2001 From: Alejo Thomas Ortega Date: Wed, 10 Jan 2024 16:02:15 -0300 Subject: [PATCH] fix: build nodejs from plain windows --- Dockerfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 001b3d7b..10bdad66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,28 @@ 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 henriqueholtz/node-win:18.12.1 as scene-lod-build +# Use a basic Windows Server Core image +FROM mcr.microsoft.com/windows/servercore:ltsc2019 as base -WORKDIR /scene-lod +# Install Node.js +ADD https://nodejs.org/dist/v18.0.0/node-v18.0.0-win-x64.zip C:\\node.zip +RUN powershell -Command \ + Expand-Archive -Path C:\\node.zip -DestinationPath C:\\Node; \ + Remove-Item -Force C:\\node.zip -RUN apt-get update -RUN apt-get -y -qq install build-essential +# Add Node to PATH +RUN setx /M PATH "C:\Node\node-v18.0.0-win-x64;%PATH%" + +# Install Yarn +ADD https://classic.yarnpkg.com/latest.msi C:\\yarn.msi +RUN powershell -Command \ + Start-Process msiexec.exe -ArgumentList '/i', 'C:\\yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait; \ + Remove-Item -Force C:\\yarn.msi + +# Scene LOD Build +FROM base as scene-lod-build + +WORKDIR /scene-lod COPY scene-lod-entities-manifest-builder/package.json /scene-lod COPY scene-lod-entities-manifest-builder/package-lock.json /scene-lod @@ -32,13 +48,11 @@ RUN npm run build RUN npm ci --only=production -FROM henriqueholtz/node-win:18.12.1 as consumer-server-build +# Consumer Server Build +FROM base as consumer-server-build WORKDIR /consumer-server -RUN apt-get update -RUN apt-get -y -qq install build-essential - COPY consumer-server/package.json /consumer-server/package.json COPY consumer-server/yarn.lock /consumer-server/yarn.lock RUN yarn install --frozen-lockfile