Add dockerfile-windows

This commit is contained in:
Louis Lam 2022-05-18 21:29:14 +08:00
parent 9fc5a3329f
commit e0028cb114
2 changed files with 23 additions and 0 deletions

22
docker/dockerfile-windows Normal file
View File

@ -0,0 +1,22 @@
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
WORKDIR C:\\app
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
# Download Node.js 18
RUN curl.exe -o node.zip https://nodejs.org/dist/v18.2.0/node-v18.2.0-win-x64.zip && \
mkdir "C:\\Program Files\\node" && \
tar.exe -xf node.zip -C "C:\\Program Files\\node" --strip-components=1
# Add node to PATH
RUN setx path "%path%;C:\\Program Files\\node"
# Test Node & NPM
RUN node -v && \
npm -v
COPY . .
RUN npm ci --production
EXPOSE 3001
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js
CMD ["node.exe", "server/server.js"]

View File

@ -38,6 +38,7 @@
"build-docker-nightly": "npm run build && docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly --target nightly . --push",
"build-docker-nightly-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly-alpine --target nightly . --push",
"build-docker-nightly-amd64": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain",
"build-docker-nightly-windows": "docker build -f docker/dockerfile-windows -t louislam/uptime-kuma:nightly-windows . && docker push louislam/uptime-kuma:nightly-windows",
"upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain",
"setup": "git checkout 1.15.1 && npm ci --production && npm run download-dist",
"download-dist": "node extra/download-dist.js",