Kaynağa Gözat

上传文件至 ''

chenghongxi 4 yıl önce
ebeveyn
işleme
31836fa860
3 değiştirilmiş dosya ile 60 ekleme ve 0 silme
  1. 16 0
      Dockerfile
  2. 36 0
      nginx.conf
  3. 8 0
      push.sh

+ 16 - 0
Dockerfile

@@ -0,0 +1,16 @@
+FROM nginx:1.15.6
+
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+RUN echo 'Asia/Shanghai' > /etc/timezone
+
+RUN rm -f /etc/nginx/conf.d/default.conf
+COPY nginx.conf /etc/nginx/nginx.conf
+COPY conf.d /etc/nginx/conf.d/
+COPY ssl /etc/nginx/ssl/
+
+RUN rm -rf /usr/share/nginx/html
+RUN mkdir /usr/share/nginx/html
+#COPY html /usr/share/nginx/html/
+
+EXPOSE 80
+EXPOSE 443

+ 36 - 0
nginx.conf

@@ -0,0 +1,36 @@
+user                    nginx;
+worker_processes        auto;
+worker_cpu_affinity     auto;
+worker_rlimit_nofile    1048576;
+worker_shutdown_timeout 10s ;
+
+error_log               /var/log/nginx/error.log warn;
+pid                     /var/run/nginx.pid;
+
+events {
+    multi_accept        on;
+    worker_connections  65536;
+    use                 epoll;
+}
+
+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" '
+                        '$upstream_addr $upstream_status $upstream_cache_status $upstream_response_time $request_time $host';
+
+    access_log           /var/log/nginx/access.log  main;
+
+    sendfile             on;
+    #tcp_nopush          on;
+
+    keepalive_timeout    65;
+
+    #gzip                on;
+    server_tokens        off;
+
+    include /etc/nginx/conf.d/*.conf;
+}

+ 8 - 0
push.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+release=$1
+
+[ ! -n "$release" ] && exit 1
+
+docker build -t registry-vpc.cn-beijing.aliyuncs.com/xinyue/versioncheck-nginx:${release} .
+docker push registry-vpc.cn-beijing.aliyuncs.com/xinyue/versioncheck-nginx:${release}