feat: add dockerfile for whole site

This commit is contained in:
delong.wang
2023-11-04 18:17:02 +08:00
parent ad03d47fce
commit 7efa85996a
15 changed files with 6308 additions and 10 deletions

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
website/node_modules
website/build
website/.docusaurus
blazehttp/.github

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
*.Zone.Identifier
.DS_Store
*.zip
*.tar

71
Dockerfile Normal file
View File

@@ -0,0 +1,71 @@
FROM node:20.5-alpine
RUN apk update
RUN apk add nginx tini
RUN echo -e " \n\
server { \n\
listen 80; \n\
\n\
location /api/count { \n\
proxy_pass https://rivers-telemetry.chaitin.cn:10086; \n\
} \n\
location /api/exist { \n\
proxy_pass https://rivers-telemetry.chaitin.cn:10086; \n\
} \n\
location /blazehttp { \n\
root /app/; \n\
try_files \$uri =404; \n\
} \n\
location /release { \n\
root /app/; \n\
try_files \$uri =404; \n\
} \n\
location / { \n\
rewrite /posts/guide_introduction /docs/ permanent; \n\
rewrite /posts/guide_install /docs/guide/install permanent; \n\
rewrite /docs/上手指南/guide_install /docs/guide/install permanent; \n\
rewrite /posts/guide_login /docs/guide/login permanent; \n\
rewrite /docs/上手指南/guide_login /docs/guide/login permanent; \n\
rewrite /posts/guide_config /docs/guide/config permanent; \n\
rewrite /docs/上手指南/guide_config /docs/guide/config permanent; \n\
rewrite /posts/guide_test /docs/guide/test permanent; \n\
rewrite /docs/上手指南/guide_test /docs/guide/test permanent; \n\
rewrite /posts/guide_upgrade /docs/guide/upgrade permanent; \n\
rewrite /docs/上手指南/guide_upgrade /docs/guide/upgrade permanent; \n\
rewrite /posts/faq_install /docs/faq/install permanent; \n\
rewrite /docs/常见问题排查/faq_install /docs/faq/install permanent; \n\
rewrite /posts/faq_login /docs/faq/login permanent; \n\
rewrite /docs/常见问题排查/faq_login /docs/faq/login permanent; \n\
rewrite /posts/faq_access /docs/guide/config permanent; \n\
rewrite /docs/常见问题排查/faq_access /docs/guide/config permanent; \n\
rewrite /posts/faq_config /docs/faq/config permanent; \n\
rewrite /docs/常见问题排查/faq_config /docs/faq/config permanent; \n\
rewrite /posts/faq_other /docs/faq/other permanent; \n\
rewrite /docs/常见问题排查/faq_other /docs/faq/other permanent; \n\
rewrite /posts/about_syntaxanalysis /docs/about/syntaxanalysis permanent; \n\
rewrite /docs/关于雷池/about_syntaxanalysis /docs/about/syntaxanalysis permanent; \n\
rewrite /posts/about_challenge /docs/about/challenge permanent; \n\
rewrite /docs/关于雷池/about_challenge /docs/about/challenge permanent; \n\
rewrite /posts/about_changelog /docs/about/changelog permanent; \n\
rewrite /docs/关于雷池/about_changelog /docs/about/changelog permanent; \n\
rewrite /posts/about_chaitin /docs/about/chaitin permanent; \n\
rewrite /docs/关于雷池/about_chaitin /docs/about/chaitin permanent; \n\
rewrite /docs/faq/access /docs/guide/config permanent; \n\
rewrite /docs/faq/config /docs/guide/config permanent; \n\
proxy_pass http://127.0.0.1:3000; \n\
} \n\
} \n\
" > /etc/nginx/http.d/default.conf
RUN sed -i 's/access_log/access_log off; #/' /etc/nginx/nginx.conf
RUN nginx -t
COPY release /app/release
COPY blazehttp /app/blazehttp
COPY website /app
WORKDIR /app
RUN npm ci
RUN npm run build
CMD nginx; tini -- npm run serve

19
release/ipgroup/README.md Normal file
View File

@@ -0,0 +1,19 @@
# 雷池内置 IP 组
### 国家 IP 库
定期手动更新,数据来源 https://ipv4.fetus.jp/tw
### 爬虫 IP 库
##### cloudflare
官方 https://www.cloudflare.com/ips-v4
##### 360
http://www.so.com/help/spider_ip.html
##### 百度
没有爬虫 IP 池,官方推荐的判断方法 https://ziyuan.baidu.com/college/articleinfo?id=1198

View File

@@ -0,0 +1,26 @@
# http://www.so.com/help/spider_ip.html
180.153.232.0/24
180.153.234.0/24
180.153.236.0/24
180.163.220.0/24
42.236.101.0/24
42.236.102.0/24
42.236.103.0/24
42.236.10.0/24
42.236.12.0/24
42.236.13.0/24
42.236.14.0/24
42.236.15.0/24
42.236.16.0/24
42.236.17.0/24
42.236.46.0/24
42.236.48.0/24
42.236.49.0/24
42.236.50.0/24
42.236.51.0/24
42.236.52.0/24
42.236.53.0/24
42.236.54.0/24
42.236.55.0/24
42.236.99.0/24

View File

@@ -0,0 +1,17 @@
# sync from https://www.cloudflare.com/ips-v4
173.245.48.0/20
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
141.101.64.0/18
108.162.192.0/18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
198.41.128.0/17
162.158.0.0/15
104.16.0.0/13
104.24.0.0/14
172.64.0.0/13
131.0.72.0/22

6163
release/ipgroup/geo/cn.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
node_modules
build
.docusaurus

View File

@@ -1,7 +0,0 @@
FROM node:20.5-alpine
COPY . /app
WORKDIR /app
RUN npm ci
RUN npm run build
CMD npm run serve -- --port 80 --host 0.0.0.0

5
website/compose.yml Normal file
View File

@@ -0,0 +1,5 @@
services:
web:
image: safeline-official:2
ports:
- 80:80