From c293c110eea40f8e84b7ed36821e1aef56b37a4a Mon Sep 17 00:00:00 2001 From: EnderByEndera <707475564@qq.com> Date: Tue, 23 Jan 2024 09:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++ prepare.sh | 26 ++++++++ src/main/resources/nginx/nginx.conf | 84 ++++++++++++++++++++++++++ src/main/resources/static/favicon.ico | Bin 0 -> 15086 bytes src/main/resources/static/test.html | 47 ++++++++++++++ 5 files changed, 166 insertions(+) create mode 100644 Dockerfile create mode 100644 prepare.sh create mode 100644 src/main/resources/nginx/nginx.conf create mode 100644 src/main/resources/static/favicon.ico create mode 100644 src/main/resources/static/test.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6979d37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:latest + +LABEL authors="Endera" + +EXPOSE 8081 + +COPY prepare.sh /root/prepare.sh + +ENTRYPOINT ["bash", "/root/prepare.sh"] \ No newline at end of file diff --git a/prepare.sh b/prepare.sh new file mode 100644 index 0000000..eb7eb1b --- /dev/null +++ b/prepare.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +cd ~ + +bash -c "cat << EOF > /etc/apt/sources.list && apt update +deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse +EOF" + +apt install sudo git wget openjdk-17-jdk -y + +git config --global user.name "EnderByEndera" +git config --global user.password "8Bs8hxHtE-iq44g" + +git clone https://git.mesalab.cn/EnderByEndera/realtime_protection.git + +cd realtime_protection +./gradlew clean && ./gradlew bootJar \ No newline at end of file diff --git a/src/main/resources/nginx/nginx.conf b/src/main/resources/nginx/nginx.conf new file mode 100644 index 0000000..41e2748 --- /dev/null +++ b/src/main/resources/nginx/nginx.conf @@ -0,0 +1,84 @@ +user root root; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; + # multi_accept on; +} + +http { + + ## + # Basic Settings + ## + + sendfile on; + tcp_nopush on; + types_hash_max_size 2048; + # server_tokens off; + + # server_names_hash_bucket_size 64; + # server_name_in_redirect off; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ## + # SSL Settings + ## + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE + ssl_prefer_server_ciphers on; + + ## + # Logging Settings + ## + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + ## + # Gzip Settings + ## + + gzip on; + + # gzip_vary on; + # gzip_proxied any; + # gzip_comp_level 6; + # gzip_buffers 16 8k; + # gzip_http_version 1.1; + # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + ## + # Virtual Host Configs + ## + + include /etc/nginx/conf.d/*.conf; + include /etc/nginx/sites-enabled/*; + include /home/wzw/nginx/configs/*.conf; +} + + +#mail { +# # See sample authentication script at: +# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript +# +# # auth_http localhost/auth.php; +# # pop3_capabilities "TOP" "USER"; +# # imap_capabilities "IMAP4rev1" "UIDPLUS"; +# +# server { +# listen localhost:110; +# protocol pop3; +# proxy on; +# } +# +# server { +# listen localhost:143; +# protocol imap; +# proxy on; +# } +#} diff --git a/src/main/resources/static/favicon.ico b/src/main/resources/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..478c8176f6658abea49e884825c249ad7725bea8 GIT binary patch literal 15086 zcmcJW3$RsH8OQha07qV45CV$Fy`&Imp`tR55f`d)nn{FlMu=e4Vw_9`Urpts&P57H z3{!k10%{`#iaJ?Dqm2iXN5DWJ@koJ#5TKKCdC5TzclY}r_B!sf&wk!>yE8w&z1R9) zYpuQ4-fQiHWz|?I>*9+oWWDu=0hTq)vaI@g=e&z$?V_v;QuQ~tv8)*=3_=GJ>qby{ z@$dXIqBZ|rJNxTxpdQA;ba)xo!!Fnl|AC#b7G8u#7!Ca()tb2^@kQ(&FbSYf`0fZdz(3(MMCFyV zzJO1)V*<1f%f+t_n;N(PI(X|T8wiUa4@vV%s{aWw7Qz?3c|@IKGY2w|Ho6>t6E;E8 zJgU{#Sd1`v#F6Mf1-hp1g|lHiX#S`+mzLV+h&?7w?$SZ`NhjB%$R%*VIZqm2*RtlA zLk^moRF>3_^fd>MjnfA7O#VsZXihu`%OC^S!EhMr@HM2y@&WiOd^U6y$2@8D5+;+=o6UwB>C&wcnJDOf+|FJ|6?TtyK4ikG7y|OYay_Z8(9>^+6G-i<7_RwabEhw6q+bUxh6Y z)rJk|^!AHGd7S(oL$95meYIuyRU4x23Egu)@{2`zoc#5CydO%>I6q%4EyJ(ouEP*E z4tn>hcvqqA^zy}#%hzAkBwVfy&%31-}NjlK=zpktVwUmZ4S_#=dk!GnIbEiEIK^55o( zsrl+v7zJ&U_(osv!D0FTIf=h0U1Is=Z{llC_$}x?>8vPUsz+}OgsoAx#PJhXhgf0x zn|AC)Pw%01QGU@G24T;F{ZT%W)DtUC{%VJwp}NN>L*V>NT|amhUV)c=c>bEDO>^K; zALddv9b(TR_>Y^v+Ms@&0fFx#)ae~nb8;Z$cLeMJKBWA@xMM(^IQi>-R)3C!MEA2_ z9_06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Ef#UaVq}F_o zfj7QvwDv4}FAR(8uES3I#%hDtug+hDVtm3)#Es?E)ARKK z=;86*p0bK-$gSh_gZ4>>!4t3>yz`_tp3bGC`Rq~9UW)JgfHzjyIX?7$FbHl1J+F7b z5h#HASI65y^P1*!?O_FuuRE5uKkP;}A=p097R?&A6S6gpwb{CSI@?f4XEV*IY{sr( zKVupj94qXTcGk{kpe|?U)46m$ZKv~fb}FB-QzvbEI!e>*LaNcmPBau!xw?F+DV0sJ zRnbi`*xSeyV-j2Y6nb#hLusEP^vWo%Z}h%C66V9ZaLnP~$aydV%Dix{-`8t>)&pjN z{;z;}Z}Q3ysG9+$Z&*5pCGdABfNZqB(pv8|&^krOX3eE{1HB6seIT`;uog@#>D~Z6 zLG2N};CrwGq^C8c)=(*M+spS|beZoTb;Dpg$cNgZzUl*#gQz_e1UIrAKP7UV5axI~H~0 zK<&{OE`}khN9uiXE^LLh*sp>OFdItOHg(2c{jNMp`|#^#kLnB>H+?7B3%WlyLh1dO zx-qa4CZgM^^P9Hzvh^$}n;$q|1hUs0{vFc>?9PGGbwZt*MVfSG$WU+WvXp68E%?2V7{9G?ryS96uxIRWI~=oRhdpEBk4imUDf$Ldqf z8+s=YZyL&0A$-&UqTtAHRovpgB`$jMQgW sLD_mP&+0qJerO{jKXZ>|J$x9+gwiaou&jO!z$8{@>X2DRP&TstAM!6YdH?_b literal 0 HcmV?d00001 diff --git a/src/main/resources/static/test.html b/src/main/resources/static/test.html new file mode 100644 index 0000000..fe894c4 --- /dev/null +++ b/src/main/resources/static/test.html @@ -0,0 +1,47 @@ + + + + cors test + + + + + +
+

Cors Test


+

input your target api address:

+


+

input your token:

+

+ +
+ + + + + + + + +