zhangys36 před 2 roky
rodič
revize
9d457ffa6c
4 změnil soubory, kde provedl 80 přidání a 3 odebrání
  1. 6 3
      .drone.yml
  2. 13 0
      Dockerfile
  3. 28 0
      nginx-conf/conf.d/default.conf
  4. 33 0
      nginx-conf/nginx.conf

+ 6 - 3
.drone.yml

@@ -31,10 +31,12 @@ steps:
       password: $jgkj001
       debug: true
       target: /www/wwwroot/railway-web.iamsee.com/release
-      source: dist
+      source:
+        - dist
+        - Dockerfile
       rm: true
-  - name: deploy
-    image:  appleboy/drone-ssh
+  - name: deploy-build-image
+    image: appleboy/drone-ssh
     settings:
       host: gdsc.ninecase.top
       username: root
@@ -43,6 +45,7 @@ steps:
       script:
         - export PATH=/usr/local/bin:$PATH
         - echo $PATH
+        - docker build -t iamsee/gdsc-web:1.0.0 .
 volumes:
   - name: cache # The name use in this pipeline,
     host:

+ 13 - 0
Dockerfile

@@ -0,0 +1,13 @@
+# Version 1.0.0
+FROM nginx:1.20.0
+
+MAINTAINER iamsee "root@iamsee.com"
+
+# The environment variable
+ENV APP_NAME="web_frontend"
+
+COPY nginx-conf /etc/nginx/
+
+EXPOSE 80
+
+COPY dist /usr/share/nginx/html/gis

+ 28 - 0
nginx-conf/conf.d/default.conf

@@ -0,0 +1,28 @@
+# from gis project
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name  localhost;
+
+    set $root  '/usr/share/nginx/html';
+    root $root;
+    location / {
+        index  index.html index.htm;
+        try_files $uri $uri/ /gis/index.html;
+        add_header Access-Control-Allow-Origin *;
+        autoindex off;   #开启nginx目录浏览功能
+        autoindex_exact_size off;   #文件大小从KB开始显示
+        autoindex_localtime on;   #显示文件修改时间为服务器本地时间
+    }
+    location ~ /.well-known {
+        allow all;
+        autoindex on;
+        autoindex_exact_size off;
+        autoindex_localtime on;
+    }
+
+    #location ~ /\.ht {
+    #    deny  all;
+    #}
+}
+

+ 33 - 0
nginx-conf/nginx.conf

@@ -0,0 +1,33 @@
+# from gis project
+
+user  nginx;
+worker_processes  1;
+
+error_log  /var/log/nginx/error.log warn;
+pid        /var/run/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       /etc/nginx/mime.types;
+    default_type  application/octet-stream;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    access_log  /var/log/nginx/access.log  main;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    keepalive_timeout  65;
+
+    #gzip  on;
+
+    include /etc/nginx/conf.d/*.conf;
+}