浏览代码

feat: build

wanghongkai 5 年之前
父节点
当前提交
94d9c05afe
共有 3 个文件被更改,包括 23 次插入1 次删除
  1. 11 0
      Dockerfile
  2. 11 0
      nginx.conf
  3. 1 1
      src/views/login/Login.vue

+ 11 - 0
Dockerfile

@@ -0,0 +1,11 @@
+FROM node:10-alpine as builder  
+WORKDIR /code
+RUN yarn config set registry https://registry.npm.taobao.org/
+ADD package.json /code
+RUN yarn install --production  
+ADD . /code  
+RUN yarn build
+
+FROM nginx:1.19-alpine
+COPY nginx.conf /etc/nginx/conf.d/nginx.conf
+COPY --from=builder /code/dist/ /var/www/html/dist/

+ 11 - 0
nginx.conf

@@ -0,0 +1,11 @@
+server {
+  listen 80 default_server;
+  listen [::]:80 default_server;
+  root /var/www/html/dist;
+  location ~ / {
+    if ($request_uri ~* (api)) {
+        proxy_pass http://environment-9-3.seec.svc.cluster.local:8080;
+    }
+    try_files $uri $uri/ /index.html;
+  }
+}

+ 1 - 1
src/views/login/Login.vue

@@ -85,7 +85,7 @@ export default {
   methods: {
     async loginAction() {
       window.location = `http://p.seecoder.cn/api/interaction?scope=openid&client_id=seec-seec&redirect_uri=${encodeURI(
-        "http://seec.seecoder.cn/api/auth/receive"
+        "http://seecoder-ii-pool.seec.seecoder.cn/api/auth/receive"
       )}`;
       // if (this.submitting) return;