From 0946ec3e7b19df9bee1dedef9878cfdb1292667a Mon Sep 17 00:00:00 2001 From: wenlele Date: Tue, 17 Jan 2023 13:31:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E7=BB=B4=E5=B7=A1=E6=A3=80=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/Dockerfile | 42 +++++++++++++++---- web/client/src/index.js | 2 +- .../src/layout/components/header/index.js | 2 +- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 1b44544..9b902d0 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,4 +1,27 @@ -FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 +# FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 + +# COPY . /var/app + +# WORKDIR /var/app + +# EXPOSE 8080 + +# RUN npm cache clean -f + +# RUN npm install --registry http://10.8.30.22:7000 --legacy-peer-deps +# RUN export NODE_OPTIONS=--max_old_space_size=4096&&npm run build +# RUN rm -rf client/src +# RUN rm -rf node_modules + +# RUN npm install --production --registry http://10.8.30.22:7000 +# #RUN npm cache clean -f && npm install --production --force --registry http://10.8.30.22:7000 + +# CMD ["-u", "http://localhost:8088"] + +# ENTRYPOINT [ "node", "server.js" ] + + +FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder COPY . /var/app @@ -6,16 +29,19 @@ WORKDIR /var/app EXPOSE 8080 +RUN npm config set registry=http://10.8.30.22:7000 +RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f - -RUN npm install --registry http://10.8.30.22:7000 --legacy-peer-deps -RUN export NODE_OPTIONS=--max_old_space_size=4096&&npm run build +RUN npm install --registry http://10.8.30.22:7000 +RUN npm run build RUN rm -rf client/src RUN rm -rf node_modules - RUN npm install --production --registry http://10.8.30.22:7000 -#RUN npm cache clean -f && npm install --production --force --registry http://10.8.30.22:7000 -CMD ["-u", "http://localhost:8088"] +FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 + +COPY --from=builder --chown=node /var/app /home/node/app + +WORKDIR /home/node/app -ENTRYPOINT [ "node", "server.js" ] \ No newline at end of file +CMD ["node", "server.js"] \ No newline at end of file diff --git a/web/client/src/index.js b/web/client/src/index.js index aba3f6d..dac0415 100644 --- a/web/client/src/index.js +++ b/web/client/src/index.js @@ -4,4 +4,4 @@ import React from 'react'; import { render } from 'react-dom'; import App from './app'; -render((), document.getElementById('App')); \ No newline at end of file +render((), document.getElementById('App')); \ No newline at end of file diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js index c1df51f..3e088ae 100644 --- a/web/client/src/layout/components/header/index.js +++ b/web/client/src/layout/components/header/index.js @@ -38,7 +38,7 @@ const Header = props => {
{/* */} - 巡检WEB + 运维巡检平台