diff --git a/Dockerfile b/Dockerfile index c37ebca..0d4f56b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ ARG NODE_VERSION=lts -ARG PUBLIC_PATH=/ FROM node:${NODE_VERSION}-alpine as base WORKDIR /usr/src/app @@ -19,15 +18,17 @@ RUN --mount=type=bind,source=package.json,target=package.json \ npm ci COPY . . +ARG PUBLIC_PATH=/ +ENV PUBLIC_PATH=$PUBLIC_PATH RUN npm run build FROM nginx:alpine-slim as final - +ARG PUBLIC_PATH=/ ENV PUBLIC_PATH=$PUBLIC_PATH RUN rm -f /etc/nginx/conf.d/default.conf COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf -COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui${PUBLIC_PATH} +COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui${PUBLIC_PATH}/ -COPY entrypoint.sh /opt/msp/isp-admin-ui${PUBLIC_PATH}entrypoint.sh -ENTRYPOINT sh -c "/opt/msp/isp-admin-ui${PUBLIC_PATH}entrypoint.sh" +COPY entrypoint.sh /opt/msp/isp-admin-ui${PUBLIC_PATH}/entrypoint.sh +ENTRYPOINT sh -c "/opt/msp/isp-admin-ui${PUBLIC_PATH}/entrypoint.sh" diff --git a/cfg/80_isp-admin-ui.conf b/cfg/80_isp-admin-ui.conf index 8f1f3d9..c1dc423 100644 --- a/cfg/80_isp-admin-ui.conf +++ b/cfg/80_isp-admin-ui.conf @@ -7,7 +7,7 @@ server { add_header Cache-Control "no-cache, no-store, must-revalidate"; add_header Pragma "no-cache"; # Для совместимости с HTTP/1.0 expires off; - try_files $uri __PUBLIC_PATH__index.html; + try_files $uri __PUBLIC_PATH__/index.html; } location /api { diff --git a/entrypoint.sh b/entrypoint.sh index e36fee7..8240c7c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,7 +9,7 @@ echo "Using normalized PUBLIC_PATH: '$PUBLIC_PATH'" # Генерация конфигурации приложения CONFIG_DIR="/opt/msp/isp-admin-ui${PUBLIC_PATH}" -CONFIG_PATH="${CONFIG_DIR}config.js" +CONFIG_PATH="${CONFIG_DIR}/config.js" mkdir -p "$CONFIG_DIR" diff --git a/index.html b/index.html index 0e3f7ec..3e1d51a 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - + Панель администратора diff --git a/package-lock.json b/package-lock.json index 6db2ac0..ab6e91a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@reduxjs/toolkit": "^2.2.3", "axios": "^1.7.7", "dayjs": "^1.11.10", - "isp-admin-ui-kit": "^1.5.2", + "isp-admin-ui-kit": "^1.5.4", "isp-ui-kit": "^0.23.0", "monaco-editor": "^0.52.0", "react": "^18.2.0", @@ -9709,9 +9709,9 @@ } }, "node_modules/isp-admin-ui-kit": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/isp-admin-ui-kit/-/isp-admin-ui-kit-1.5.2.tgz", - "integrity": "sha512-lwg7q4UD0fP+YE8bCSIz/KZKg/+WjBrRsnfQeuNydcznpZjuUuJm9GaE50Hu3WVd2HqBeD4mMlHeN55onBQP0g==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/isp-admin-ui-kit/-/isp-admin-ui-kit-1.5.4.tgz", + "integrity": "sha512-AfWitFUw1+/zZZrXtAoTwvF8+v6njSi1j50+M95iSkzxpyDA+t7NIF4/IjTKzrE5CPdXZI6yd1dvxDg3aiIvMw==", "dependencies": { "@apidevtools/json-schema-ref-parser": "^9.0.6", "@rjsf/antd": "^5.21.2", diff --git a/package.json b/package.json index 13e61f9..8967641 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "start": "vite", - "build": "vite build && node generateVersionFile.cjs", + "build": "NODE_OPTIONS=--max-old-space-size=4096 vite build && node generateVersionFile.cjs", "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"", @@ -18,7 +18,7 @@ "@reduxjs/toolkit": "^2.2.3", "axios": "^1.7.7", "dayjs": "^1.11.10", - "isp-admin-ui-kit": "^1.5.2", + "isp-admin-ui-kit": "^1.5.4", "isp-ui-kit": "^0.23.0", "monaco-editor": "^0.52.0", "react": "^18.2.0",