Update build webui

This commit is contained in:
2025-02-01 17:06:36 +07:00
parent 31f9d6ab5d
commit 7b02aeb68e
4 changed files with 16 additions and 1201 deletions

View File

@@ -1,9 +1,14 @@
ARG NODE_VERSION=17
ARG ALPINE_VERSION=3.19.0
FROM node:${NODE_VERSION}-alpine AS node
FROM alpine:${ALPINE_VERSION} AS builder
# Set the working directory in the container
WORKDIR /app
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
@@ -12,12 +17,14 @@ COPY --from=node /usr/local/bin /usr/local/bin
RUN node -v
# Set the working directory in the container
WORKDIR /app
# Copy the package.json and package-lock.json first to leverage Docker's cache
COPY ./src/Managing.WebApp/package*.json ./
COPY /src/Managing.WebApp/package.json ./
#RUN npm config set registry http://registry.cnpmjs.org
# Install dependencies
#RUN npm ci --production --loglevel=verbose
#RUN npm i --omit=dev --loglevel=verbose
RUN apk update && apk add --no-cache git
# Remove Yarn and Yarnpkg binaries if they exist
RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
@@ -25,23 +32,20 @@ RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
# Install Yarn globally
RUN npm install -g yarn
# Clear Yarn cache
RUN yarn cache clean
# Use npm registry
RUN yarn config set registry https://registry.npmjs.org/
# Install dependencies
#RUN npm i --max-old-space-size=12000 --loglevel=verbose
RUN yarn add eslint-plugin-jsdoc@37.9.7 --dev --ignore-engines
RUN yarn install --verbose
# Copy the application code
COPY ./src/Managing.WebApp/ /app/
COPY src/Managing.WebApp/ /app/
RUN ls -alh
RUN ls -alh src/
# Build the Vite application
#RUN npm run build
RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build
# Stage 2: Create the runtime image
FROM nginx:alpine