-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.windows
More file actions
37 lines (27 loc) · 1.11 KB
/
Dockerfile.windows
File metadata and controls
37 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Dockerfile for testing npm-practice on Windows
# Note: This requires Docker Desktop with Windows containers enabled
FROM mcr.microsoft.com/windows/servercore:ltsc2022
# Install Node.js using PowerShell
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Download and install Node.js
RUN Invoke-WebRequest -Uri 'https://nodejs.org/dist/v20.10.0/node-v20.10.0-x64.msi' -OutFile 'nodejs.msi'; \
Start-Process msiexec.exe -ArgumentList '/i', 'nodejs.msi', '/quiet', '/norestart' -Wait; \
Remove-Item 'nodejs.msi'
# Add Node to PATH
RUN setx /M PATH $($Env:PATH + ';C:\Program Files\nodejs')
# Set working directory
WORKDIR C:\\app
# Configure npm with relaxed SSL and increased timeouts
RUN npm config set strict-ssl false; \
npm config set fetch-timeout 60000; \
npm config set fetch-retry-maxtimeout 120000
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy all project files
COPY . .
# Set up test workspace
WORKDIR C:\\test-workspace
# Default command: open PowerShell for interactive testing
CMD ["powershell"]