update
This commit is contained in:
2
src/Managing.WebApp/.gitignore
vendored
2
src/Managing.WebApp/.gitignore
vendored
@@ -3,5 +3,3 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
|
|
||||||
.env
|
|
||||||
@@ -1,20 +1,41 @@
|
|||||||
FROM node:18-alpine
|
# Use an official Node.js runtime as a parent image
|
||||||
|
FROM node:18
|
||||||
|
|
||||||
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
# Install xsel for clipboard access (useful for some applications)
|
||||||
|
RUN apt-get update && apt-get install -y xsel
|
||||||
|
|
||||||
|
# Copy only package.json and package-lock.json (or yarn.lock) initially
|
||||||
|
# This takes advantage of cached Docker layers
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
# npm ci is used instead of npm install when you want a clean, exact installation
|
||||||
|
#RUN npm ci --verbose
|
||||||
|
# Try to install dependencies with a retry mechanism
|
||||||
|
#RUN for i in 1 2 3; do npm ci --verbose && break || sleep 15; done
|
||||||
|
|
||||||
|
RUN npm ci --production
|
||||||
|
|
||||||
|
# Copy the rest of your application code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Set necessary environment variables (if they are not secrets)
|
||||||
|
ENV NODE_ENV=development
|
||||||
ENV VITE_API_URL_LOCAL=https://localhost:5001
|
ENV VITE_API_URL_LOCAL=https://localhost:5001
|
||||||
ENV VITE_API_URL_SERVER=https://localhost
|
ENV VITE_API_URL_SERVER=https://localhost
|
||||||
|
|
||||||
|
# Expose port 3000 for the application
|
||||||
RUN npm install serve -g
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["npm", "run", "serve"]
|
# Install global dependencies if absolutely necessary (generally not recommended to do globally)
|
||||||
|
RUN npm install -g serve vite
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN node --max-old-space-size=4096 node_modules/.bin/vite build
|
||||||
|
|
||||||
|
# Command to run the application
|
||||||
|
CMD ["npm", "run", "serve"]
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
ARG NODE_VERSION=21.4.0
|
|
||||||
ARG ALPINE_VERSION=3.19.0
|
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS node
|
|
||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION} AS builder
|
|
||||||
|
|
||||||
COPY --from=node /usr/lib /usr/lib
|
|
||||||
COPY --from=node /usr/local/lib /usr/local/lib
|
|
||||||
COPY --from=node /usr/local/include /usr/local/include
|
|
||||||
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 ./
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN npm i --omit=dev
|
|
||||||
|
|
||||||
# Copy the application code
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Build the Vite application
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Create the runtime image
|
|
||||||
FROM nginx:alpine
|
|
||||||
|
|
||||||
# Copy the built Vite application from the builder stage
|
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
||||||
|
|
||||||
# Copy a custom Nginx configuration file (if you need one)
|
|
||||||
# COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
# Expose port 80
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
# Start the Nginx server
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
32
src/Managing.WebApp/install_problematic_packages.sh
Normal file
32
src/Managing.WebApp/install_problematic_packages.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Array of known potentially hanging packages
|
||||||
|
hanging_packages=("xmlhttprequest-ssl@latest" "engine.io-parser@latest")
|
||||||
|
|
||||||
|
# Timeout in seconds for each package installation attempt
|
||||||
|
|
||||||
|
|
||||||
|
install_with_timeout() {
|
||||||
|
package=$1
|
||||||
|
echo "Attempting to install $package with a timeout of $timeout_duration seconds."
|
||||||
|
# Start npm install in the background
|
||||||
|
npm install $package --verbose &> $package.log &
|
||||||
|
|
||||||
|
# Get PID of the npm process
|
||||||
|
pid=$!
|
||||||
|
|
||||||
|
# Wait for the npm process to finish or timeout
|
||||||
|
(sleep $timeout_duration && kill -0 $pid 2>/dev/null && kill -9 $pid && echo "Timeout reached for $package, process killed." && echo $package >> exclude.log) &
|
||||||
|
waiter_pid=$!
|
||||||
|
|
||||||
|
# Wait for the npm process to complete
|
||||||
|
wait $pid
|
||||||
|
|
||||||
|
# Kill the waiter process in case npm finished before the timeout
|
||||||
|
kill -0 $waiter_pid 2>/dev/null && kill -9 $waiter_pid
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install potentially hanging packages first with a timeout
|
||||||
|
for package in "${hanging_packages[@]}"; do
|
||||||
|
install_with_timeout $package
|
||||||
|
done
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
"connectkit": "^1.7.3",
|
"connectkit": "^1.7.3",
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
"jotai": "^1.6.7",
|
"jotai": "^1.6.7",
|
||||||
|
"latest-version": "^9.0.0",
|
||||||
"lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git",
|
"lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
"plotly.js": "^2.18.1",
|
"plotly.js": "^2.18.1",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Suspense, lazy } from 'react'
|
|||||||
import { Route, Routes } from 'react-router-dom'
|
import { Route, Routes } from 'react-router-dom'
|
||||||
|
|
||||||
import LayoutMain from '../../layouts'
|
import LayoutMain from '../../layouts'
|
||||||
import Desk from '../../pages/desk/Desk'
|
import DeskWidget from '../../pages/desk/deskWidget'
|
||||||
import Scenario from '../../pages/scenarioPage/scenario'
|
import Scenario from '../../pages/scenarioPage/scenario'
|
||||||
import Tools from '../../pages/toolsPage/tools'
|
import Tools from '../../pages/toolsPage/tools'
|
||||||
import Workflows from '../../pages/workflow/workflows'
|
import Workflows from '../../pages/workflow/workflows'
|
||||||
@@ -96,7 +96,7 @@ const MyRoutes = () => {
|
|||||||
index
|
index
|
||||||
element={
|
element={
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<Desk />
|
<DeskWidget />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user