Commit 2449f981 by Finley Ge Committed by GitHub

chore(deploy): use host network for fastgpt-plugin (#7273)

parent 4b7ed6c0
# 用于开发的 docker-compose 文件: # 用于开发的 docker-compose 文件:
# - 只包含 FastGPT 的最小化运行条件 # - 只包含 FastGPT 的最小化运行条件
# - 没有 FastGPT 本体 # - 没有 FastGPT 本体
# - 所有端口都映射到外层 # - 依赖服务端口映射到外层,fastgpt-plugin 使用 host network
# - fastgpt-pg: 5432 # - fastgpt-pg: 5432
# - fastgpt-mongo: 27017 # - fastgpt-mongo: 27017
# - fastgpt-redis: 6379 # - fastgpt-redis: 6379
# - fastgpt-code-sandbox: 3002 # - fastgpt-code-sandbox: 3002
# - fastgpt-mcp-server: 3003 # - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004 # - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005 # - fastgpt-volume-manager: 3005
# - opensandbox-server: 8090 # - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010 # - fastgpt-aiproxy: 3010
...@@ -248,13 +248,15 @@ services: ...@@ -248,13 +248,15 @@ services:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.1 image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.1
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
ports: network_mode: host
- 3004:3000
networks:
- fastgpt
environment: environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config] <<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
...@@ -265,7 +267,7 @@ services: ...@@ -265,7 +267,7 @@ services:
fastgpt-minio: fastgpt-minio:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/health'] test: ['CMD', 'curl', '-f', 'http://localhost:3004/health']
interval: 30s interval: 30s
timeout: 20s timeout: 20s
retries: 3 retries: 3
......
# 用于开发的 docker-compose 文件: # 用于开发的 docker-compose 文件:
# - 只包含 FastGPT 的最小化运行条件 # - 只包含 FastGPT 的最小化运行条件
# - 没有 FastGPT 本体 # - 没有 FastGPT 本体
# - 所有端口都映射到外层 # - 依赖服务端口映射到外层,fastgpt-plugin 使用 host network
# - fastgpt-pg: 5432 # - fastgpt-pg: 5432
# - fastgpt-mongo: 27017 # - fastgpt-mongo: 27017
# - fastgpt-redis: 6379 # - fastgpt-redis: 6379
# - fastgpt-code-sandbox: 3002 # - fastgpt-code-sandbox: 3002
# - fastgpt-mcp-server: 3003 # - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004 # - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005 # - fastgpt-volume-manager: 3005
# - opensandbox-server: 8090 # - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010 # - fastgpt-aiproxy: 3010
...@@ -248,13 +248,15 @@ services: ...@@ -248,13 +248,15 @@ services:
image: ghcr.io/labring/fastgpt-plugin:v1.0.1 image: ghcr.io/labring/fastgpt-plugin:v1.0.1
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
ports: network_mode: host
- 3004:3000
networks:
- fastgpt
environment: environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config] <<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
...@@ -265,7 +267,7 @@ services: ...@@ -265,7 +267,7 @@ services:
fastgpt-minio: fastgpt-minio:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/health'] test: ['CMD', 'curl', '-f', 'http://localhost:3004/health']
interval: 30s interval: 30s
timeout: 20s timeout: 20s
retries: 3 retries: 3
......
# 用于开发的 docker-compose 文件: # 用于开发的 docker-compose 文件:
# - 只包含 FastGPT 的最小化运行条件 # - 只包含 FastGPT 的最小化运行条件
# - 没有 FastGPT 本体 # - 没有 FastGPT 本体
# - 所有端口都映射到外层 # - 依赖服务端口映射到外层,fastgpt-plugin 使用 host network
# - fastgpt-pg: 5432 # - fastgpt-pg: 5432
# - fastgpt-mongo: 27017 # - fastgpt-mongo: 27017
# - fastgpt-redis: 6379 # - fastgpt-redis: 6379
# - fastgpt-code-sandbox: 3002 # - fastgpt-code-sandbox: 3002
# - fastgpt-mcp-server: 3003 # - fastgpt-mcp-server: 3003
# - fastgpt-plugin: 3004 # - fastgpt-plugin: 3004(host network,由 PORT 指定)
# - fastgpt-volume-manager: 3005 # - fastgpt-volume-manager: 3005
# - opensandbox-server: 8090 # - opensandbox-server: 8090
# - fastgpt-aiproxy: 3010 # - fastgpt-aiproxy: 3010
...@@ -248,13 +248,15 @@ services: ...@@ -248,13 +248,15 @@ services:
image: ${{fastgpt-plugin.image}}:${{fastgpt-plugin.tag}} image: ${{fastgpt-plugin.image}}:${{fastgpt-plugin.tag}}
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
ports: network_mode: host
- 3004:3000
networks:
- fastgpt
environment: environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config] <<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
PORT: 3004
FASTGPT_BASE_URL: http://127.0.0.1:3000
MONGODB_URI: mongodb://myusername:mypassword@127.0.0.1:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@127.0.0.1:6379
STORAGE_S3_ENDPOINT: http://127.0.0.1:9000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
...@@ -265,7 +267,7 @@ services: ...@@ -265,7 +267,7 @@ services:
fastgpt-minio: fastgpt-minio:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/health'] test: ['CMD', 'curl', '-f', 'http://localhost:3004/health']
interval: 30s interval: 30s
timeout: 20s timeout: 20s
retries: 3 retries: 3
......
...@@ -389,6 +389,7 @@ services: ...@@ -389,6 +389,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -447,6 +447,7 @@ services: ...@@ -447,6 +447,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -425,6 +425,7 @@ services: ...@@ -425,6 +425,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -409,6 +409,7 @@ services: ...@@ -409,6 +409,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -407,6 +407,7 @@ services: ...@@ -407,6 +407,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -412,6 +412,7 @@ services: ...@@ -412,6 +412,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -388,6 +388,7 @@ services: ...@@ -388,6 +388,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -447,6 +447,7 @@ services: ...@@ -447,6 +447,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -425,6 +425,7 @@ services: ...@@ -425,6 +425,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -409,6 +409,7 @@ services: ...@@ -409,6 +409,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -407,6 +407,7 @@ services: ...@@ -407,6 +407,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -412,6 +412,7 @@ services: ...@@ -412,6 +412,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
...@@ -388,6 +388,7 @@ services: ...@@ -388,6 +388,7 @@ services:
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100 DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token AUTH_TOKEN: *x-plugin-auth-token
FASTGPT_BASE_URL: http://fastgpt-app:3000
# 工具网络请求,最大请求和响应体 # 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10 SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小 # 最大 API 请求体大小
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment