Skip to content

Commit

Permalink
fix: build nodejs from plain windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega committed Jan 10, 2024
1 parent 5103a9f commit 90a54b8
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 90a54b8

Please sign in to comment.