Browse Source

添加部署文件

TitanWong 2 years ago
parent
commit
07919f5320
3 changed files with 77 additions and 0 deletions
  1. 45 0
      .drone.yml
  2. 4 0
      Dockerfile
  3. 28 0
      default.conf

+ 45 - 0
.drone.yml

@@ -0,0 +1,45 @@
+kind: pipeline
+name: default
+
+steps:
+  - name: restore-cache
+    image: drillster/drone-volume-cache
+    volumes:
+    - name: cache
+      path: /cache
+    settings:
+      restore: true
+      mount:
+        - ./node_modules
+
+  - name: build
+    image: node:16-alpine
+    commands:
+      - npm config set registry https://registry.npm.taobao.org
+      - npm install
+      - npm run build
+  
+  - name: rebuild-cache
+    image: drillster/drone-volume-cache
+    volumes:
+    - name: cache
+      path: /cache
+    settings:
+      rebuild: true
+      mount:
+        - ./node_modules
+
+  - name: docker-web
+    image: plugins/docker
+    settings:
+      tags:
+        - latest
+        - 1.0.${DRONE_BUILD_NUMBER}
+      registry: nas.fast-fun.cn:5000
+      insecure: true
+      repo: nas.fast-fun.cn:5000/zk/station-control-frontend
+
+volumes:
+  - name: cache
+    host:
+      path: /home/drone/cache

+ 4 - 0
Dockerfile

@@ -0,0 +1,4 @@
+FROM nas.fast-fun.cn:5000/nginx:alpine
+
+ADD default.conf /etc/nginx/conf.d/
+ADD dist /usr/share/nginx/html

+ 28 - 0
default.conf

@@ -0,0 +1,28 @@
+server {
+    listen       80;
+    server_name  localhost;
+
+    #charset koi8-r;
+    access_log  /var/log/nginx/host.access.log  main;
+
+    gzip on;
+    gzip_min_length 1k;
+    gzip_buffers 4 16k;
+    gzip_comp_level 8;
+    gzip_types text/plain application/javascript application/x-javascript text/css application/json text/javascript application/x-httpd-php image/jpeg image/gif image/png;
+    gzip_vary off;
+    gzip_disable "MSIE [1-6]\.";
+
+    location / {
+        root   /usr/share/nginx/html;
+        try_files $uri $uri/ /index.html;
+        index  start.html index.html;
+    }
+
+    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+    #
+    # location /api {
+    #     proxy_pass   http://api-server:8082;
+    # }
+
+}