Compare commits

...
2 Commits
5 changed files with 69 additions and 11 deletions

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
## 0.18.8
- Добавлено кеширование статики для nginx
## 0.18.7
- Включена поддержка кэширования зависимостей через Docker
- Добавлен файл конфигурации nginx
## 0.18.6 ## 0.18.6
- Обновлена версия библиотеки isp-ui-kit - Обновлена версия библиотеки isp-ui-kit
## 0.18.5 ## 0.18.5
+22 -7
View File
@@ -1,13 +1,28 @@
FROM node:20-alpine as build-deps ARG NODE_VERSION=lts
FROM node:${NODE_VERSION}-alpine as base
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY . ./
RUN apk add git FROM base as deps
RUN npm install
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --omit=dev
FROM deps as build
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
COPY . .
RUN npm run build RUN npm run build
FROM nginx:1.25-alpine-slim FROM nginx:alpine-slim as final
EXPOSE 8001
RUN rm -f /etc/nginx/conf.d/default.conf 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 cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
COPY --from=build-deps /usr/src/app/build /opt/msp/isp-admin-ui COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui
+38
View File
@@ -4,6 +4,9 @@ server {
root /opt/msp/isp-admin-ui/; root /opt/msp/isp-admin-ui/;
location / { location / {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache"; # Для совместимости с HTTP/1.0
expires off;
try_files $uri /index.html; try_files $uri /index.html;
} }
@@ -15,4 +18,39 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
} }
location /assets/ {
gzip on;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
gzip_vary on;
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
}
# Кэширование для шрифтов и изображений (1 неделя)
location ~* \.(?:ico|png|jpg|jpeg|svg|gif|webp|ttf|woff|woff2|otf|eot)$ {
gzip on;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
gzip_vary on;
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
}
# Кэширование JS и CSS (1 неделя)
location ~* \.(?:js|css)$ {
gzip on;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
gzip_vary on;
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
}
} }
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"version": "0.18.6", "version": "0.18.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"version": "0.18.6", "version": "0.18.8",
"dependencies": { "dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6", "@apidevtools/json-schema-ref-parser": "^9.0.6",
"@monaco-editor/react": "^4.6.0", "@monaco-editor/react": "^4.6.0",
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"private": true, "private": true,
"version": "0.18.6", "version": "0.18.8",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",
@@ -11,7 +11,7 @@
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"", "fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"analyze": "source-map-explorer 'build/static/js/*.js'", "analyze": "source-map-explorer 'build/static/js/*.js'",
"prepare": "husky install" "prepare": "husky || true"
}, },
"dependencies": { "dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6", "@apidevtools/json-schema-ref-parser": "^9.0.6",