Переглянути джерело

Merge branch 'master' of http://gogsb.soaringnova.com/liutao/ai-proj-demo

Leo 2 роки тому
батько
коміт
ef49649563
4 змінених файлів з 31 додано та 1 видалено
  1. 1 0
      .env.txprod
  2. 24 0
      Dockerfile.txprod
  3. 5 1
      Makefile
  4. 1 0
      package.json

+ 1 - 0
.env.txprod

@@ -0,0 +1 @@
+REACT_APP_BASE_URL = 'http://aihub-dag.digitalyili.com/'

+ 24 - 0
Dockerfile.txprod

@@ -0,0 +1,24 @@
+FROM node:16-buster as build
+WORKDIR /workspace
+COPY package.json .
+RUN npm install  --force --registry=https://registry.npm.taobao.org
+ADD . /workspace
+RUN npm run build:txprod
+
+
+FROM nginx:mainline
+WORKDIR /usr/share/nginx/html
+COPY --from=build /workspace/build /usr/share/nginx/html/dag
+RUN echo "\
+server {\n\
+    listen 80;\n\
+    listen [::]:80;\n\
+\n\
+    root /usr/share/nginx/html/dag;\n\
+    index index.html index.htm;\n\
+\n\
+    location / {\n\
+    try_files \$uri \$uri/ /index.html;\n\
+    }\n\
+}\n\
+" > /etc/nginx/conf.d/default.conf

+ 5 - 1
Makefile

@@ -25,4 +25,8 @@ sxkj:
 
 txtest:
 	@docker build . -t registry.cn-hangzhou.aliyuncs.com/sxtest/dag-frontend:txtest -f Dockerfile.txtest
-	@docker push registry.cn-hangzhou.aliyuncs.com/sxtest/dag-frontend:txtest
+	@docker push registry.cn-hangzhou.aliyuncs.com/sxtest/dag-frontend:txtest
+
+txprod:
+	@docker build . -t registry.cn-hangzhou.aliyuncs.com/sxtest/dag-frontend:txprod -f Dockerfile.txprod
+	@docker push registry.cn-hangzhou.aliyuncs.com/sxtest/dag-frontend:txprod

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "build:idctest": "dotenv -e .env.idctest react-scripts build",
     "build:sxkj": "dotenv -e .env.sxkj react-scripts build",
     "build:txtest": "dotenv -e .env.txtest react-scripts build",
+    "build:txprod": "dotenv -e .env.txprod react-scripts build",
     "test": "react-scripts test",
     "eject": "react-scripts eject"
   },