-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
160 changed files
with
7,175 additions
and
4,172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ | ||
release/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
package-lock.json | ||
tests/**/coverage/ | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
|
||
.vercel | ||
docker-compose.dev.yml | ||
Dockerfile.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: Release | |
|
||
on: | ||
push: | ||
# branches: [for debug] | ||
tags: | ||
- 'v*.*.*' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,6 @@ Thumbs.db | |
# *-lock.json | ||
-error.log | ||
.vercel | ||
nginx-test.conf | ||
docker-compose.dev.yml | ||
Dockerfile.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:lts-alpine as builder | ||
|
||
WORKDIR /test-server | ||
|
||
# api 测试服务端口 | ||
ENV NODE_SERVER_PORT 4201 | ||
# websocket 测试服务端口 | ||
ENV EOAPI_WEBSOCKET_POST 4202 | ||
|
||
COPY /src/workbench/node /test-server | ||
|
||
RUN yarn install | ||
|
||
EXPOSE 4201 4202 | ||
|
||
CMD ["yarn", "start:all"] | ||
|
||
|
||
FROM nginx:alpine as production | ||
|
||
ENV NODE_ENV production | ||
|
||
COPY ./src/workbench/browser/dist/ /usr/share/nginx/html | ||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: '3' | ||
|
||
services: | ||
eoapi: | ||
# build: 从当前路径构建镜像 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: production | ||
image: eolinker/eoapi:1.9.0 | ||
container_name: eoapi | ||
restart: always | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' | ||
ports: | ||
- '8000:80' | ||
networks: | ||
- eoapi_net | ||
|
||
eoapi-test-server: | ||
# build: 从当前路径构建镜像 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: builder | ||
image: eolinker/eoapi-test-server:1.9.0 | ||
container_name: eoapi-test-server | ||
restart: always | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' | ||
ports: | ||
- '4201:4201' | ||
- '4202:4202' | ||
networks: | ||
- eoapi_net | ||
|
||
networks: | ||
eoapi_net: | ||
name: eoapi_net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
|
||
server { | ||
listen 80; | ||
absolute_redirect off; #取消绝对路径的重定向 | ||
sendfile on; | ||
default_type application/octet-stream; | ||
|
||
gzip on; | ||
gzip_http_version 1.1; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_min_length 256; | ||
gzip_vary on; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
gzip_comp_level 9; | ||
|
||
root /usr/share/nginx/html; | ||
|
||
location / { | ||
return 301 $scheme://$http_host/zh; | ||
} | ||
|
||
location /zh { | ||
alias /usr/share/nginx/html/zh; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /zh/index.html; | ||
} | ||
|
||
location /en { | ||
alias /usr/share/nginx/html/en; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /en/index.html; | ||
} | ||
|
||
# api测试服务 | ||
location /api/unit { | ||
proxy_pass http://eoapi-test-server:4201; # 转发规则 | ||
proxy_set_header Host $proxy_host; # 修改转发请求头,让3000端口的应用可以受到真实的请求 | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
# websocket测试服务 | ||
location ~/socket.io/(.*) { | ||
proxy_pass http://eoapi-test-server:4202; # 转发规则 | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-NginX-Proxy true; | ||
proxy_redirect off; | ||
} | ||
|
||
# 后端服务 | ||
location ^~ /api { | ||
proxy_pass http://eoapi-remote-server:3000; # 转发规则 | ||
proxy_set_header Host $proxy_host; # 修改转发请求头,让3000端口的应用可以受到真实的请求 | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
# 后端服务兼容旧客户端 | ||
location ~ ^/(system|workspace|user|auth|[0-9]+/[0-9]+/api_data|[0-9]+/[0-9]+/group|[0-9]+/[0-9]+/group|[0-9]+/[0-9]+/environment|[0-9]+/[0-9]+/api_test_history|[0-9]+/[0-9]+/mock|[0-9]+/project) { | ||
proxy_pass http://eoapi-remote-server:3000; # 转发规则 | ||
proxy_set_header Host $proxy_host; # 修改转发请求头,让3000端口的应用可以受到真实的请求 | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
||
rewrite "^/(.*)$" /api/$1 break; | ||
} | ||
|
||
# location ^~ /zh/(.*)/assets/(.*)$ { | ||
# alias /usr/share/nginx/html/zh/assets/$2; | ||
# return 501 /usr/share/nginx/html/zh/assets/$2; | ||
#} | ||
|
||
# location ^~ /zh/\.(gif|jpg|jpeg|png|css|js|ico|svg|ttf|woff2|woff|txt)$ { | ||
# alias /usr/share/nginx/html/zh/$1; | ||
# return 502 /usr/share/nginx/html/zh/$1; | ||
#} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.