Browse Source

feat "zhurui:AI对话框组件"

Leonezhurui 2 năm trước cách đây
mục cha
commit
dd84d2f88f
3 tập tin đã thay đổi với 76 bổ sung0 xóa
  1. 50 0
      .drone.yml
  2. 6 0
      Dockerfile
  3. 20 0
      nginx.conf

+ 50 - 0
.drone.yml

@@ -0,0 +1,50 @@
+kind: pipeline
+type: docker
+name: default
+
+steps:
+  # 第一步,npm安装依赖并构建
+  - name: npm
+    image: node:18-alpine
+    commands:
+      - npm config set strict-ssl false
+      - npm config set registry https://registry.npm.taobao.org/
+      - npm
+      - npm build
+
+  # 第二步,上传镜像到阿里云容器镜像服务
+  - name: docker
+    image: plugins/docker
+    settings:
+      username:
+        from_secret: docker-username
+      password:
+        from_secret: docker-password
+      registry: registry.cn-hangzhou.aliyuncs.com
+      repo: registry.cn-hangzhou.aliyuncs.com/english-ai/eai-frontend
+
+  # 第三部,部署,通过ssh进行部署
+  - name: deploy-with-ssh
+    image: appleboy/drone-ssh
+    environment:
+      CONTAINER_NAME: eai-frontend
+      DOCKER_USERNAME:
+        from_secret: docker-username
+      DOCKER_PASSWORD:
+        from_secret: docker-password
+      DOCKER_REGISTRY: registry.cn-hangzhou.aliyuncs.com
+      IMAGE_NAME: english-ai/eai-frontend
+      IMAGE_TAG: latest
+    settings:
+      host: 47.111.23.171
+      username: root
+      password:
+        from_secret: server-password
+      port: 22
+      envs: [ DOCKER_USERNAME,DOCKER_PASSWORD,DOCKER_REGISTRY,CONTAINER_NAME,IMAGE_NAME,IMAGE_TAG ]
+      script:
+        - echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin $DOCKER_REGISTRY
+        - tag=$DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
+        - docker pull $tag
+        - if [ $(docker ps -aq -f name=eai-frontend) ]; then docker rm -f eai-frontend; fi
+        - docker run -d -p 8082:80 -v $(pwd)/logs/frontend:/var/log/nginx --name eai-frontend registry.cn-hangzhou.aliyuncs.com/english-ai/eai-frontend

+ 6 - 0
Dockerfile

@@ -0,0 +1,6 @@
+# Nginx serve stage
+FROM nginx:stable-alpine
+COPY dist /usr/share/nginx/html
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+EXPOSE 80
+CMD ["nginx", "-g", "daemon off;"]

+ 20 - 0
nginx.conf

@@ -0,0 +1,20 @@
+server {
+    listen 80;
+
+    location / {
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+        try_files $uri $uri/ /index.html;
+    }
+
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    http {
+        access_log /var/log/nginx/access.log;
+        error_log /var/log/nginx/error.log;
+    }
+
+}