From 1e79eeb6b9a613638354ef55c9409186ea7ad93a Mon Sep 17 00:00:00 2001 From: yms Date: Mon, 28 Oct 2024 11:44:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 17 +++++++++++++ builder.sh | 21 ++++++++++++++++ config/nginx.conf | 24 +++++++++++++++++++ docker_start.sh | 14 +++++++++++ .../components/TodayEvent/index.less | 1 - 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100755 builder.sh create mode 100644 config/nginx.conf create mode 100644 docker_start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..723e574 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM registry.hncy.info/nginx:1.27.2-bookworm + +WORKDIR /usr/src/app/ + +COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf + +COPY ./dist /usr/share/nginx/html/ + +COPY ./docker_start.sh /usr/bin/docker_start.sh + +# COPY ./regist-to-eureka /opt/regist-to-eureka + +EXPOSE 80 + +RUN chmod +x /usr/bin/docker_start.sh + +CMD ["docker_start.sh"] diff --git a/builder.sh b/builder.sh new file mode 100755 index 0000000..f84c68d --- /dev/null +++ b/builder.sh @@ -0,0 +1,21 @@ +#!/bin/bash +git checkout $gitTag + +repo=registry.hncy.info/hncy/cd-quality-of-urban-management +tag=${1:-$gitTag} +echo $tag +# git submodule update --init --recursive +# if [ ! -f regist-to-eureka/reg2eureka.sh ]; then +# exit 1 +# fi +rm -rf dist +# rm -rf node_modules +# rm -rf pnpm-lock.yaml +# pnpm i +# pnpm run build +npm install +npm run build:dev + +# docker buildx use desktop-linux +docker buildx build --platform linux/arm64,linux/amd64 -t $repo:$tag . --push + diff --git a/config/nginx.conf b/config/nginx.conf new file mode 100644 index 0000000..d170430 --- /dev/null +++ b/config/nginx.conf @@ -0,0 +1,24 @@ + server { + listen 80; + fastcgi_buffers 8 256k; + send_timeout 60; + gzip on; + gzip_min_length 1k; + gzip_comp_level 9; + gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + # 本地测试 + # root html/dist; + # 生产 + root /usr/share/nginx/html; + + location = /favicon.ico { + allow all; + } + + location / { + try_files $uri $uri/ /index.html; + } + +} diff --git a/docker_start.sh b/docker_start.sh new file mode 100644 index 0000000..0b0efbd --- /dev/null +++ b/docker_start.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# source utils.sh + +# replace $NGINX_DEFAULT_CONFIG PROXY_ +# replace "umi.*.js" WS_SERVER_URL /usr/share/nginx/html +# sed -i "s/PROXY_WEB_SERVICE/$PROXY_WEB_SERVICE/g" /etc/nginx/conf.d/default.conf + +# sed -i "s/PROXY_DISPATCH_SERVICE/$PROXY_DISPATCH_SERVICE/g" /etc/nginx/conf.d/default.conf + + +# bash -c "/usr/bin/reg2eureka.sh &" +nginx -g 'daemon off;' + + diff --git a/src/pages/SolidWaste/components/CleanRangeModal/components/TodayEvent/index.less b/src/pages/SolidWaste/components/CleanRangeModal/components/TodayEvent/index.less index 95f1245..ddc9d4e 100644 --- a/src/pages/SolidWaste/components/CleanRangeModal/components/TodayEvent/index.less +++ b/src/pages/SolidWaste/components/CleanRangeModal/components/TodayEvent/index.less @@ -49,7 +49,6 @@ border-radius: 15px; background: rgba(255, 255, 255, 0.8); margin-bottom: 20px; - padding: 20px; } -- GitLab