在docker-compose.yaml文件中,services包括api、worker、web、db、redis、weaviate、sandbox、ssrf_proxy和nginx。如下所示:
其中,api内容如下所示:
api:
image: langgenius/dify-api:0.6.9
restart: always
environment:
# Startup mode, 'api' starts the API server.
MODE: api
# The log level for the application. Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
LOG_LEVEL: INFO
# enable DEBUG mode to output more logs
# DEBUG : true
# A secret key that is used for securely signing the session cookie and encrypting sensitive information on the database. You can generate a strong key using `openssl rand -base64 42`.
SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
# The base URL of console application web frontend, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_WEB_URL: ''
# Password for admin user initialization.
# If left unset, admin user will not be prompted for a password when creating the initial admin account.
INIT_PASSWORD: ''
# The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_API_URL: ''
# The URL prefix for Service API endpoints, refers to the base URL of the current API service if api domain is
# different from console domain.
# example: http://api.dify.ai
SERVICE_API_URL: ''
# The URL prefix for Web APP frontend, refers to the Web App base URL of WEB service if web app domain is different from
# console or api domain.
# example: http://udify.app
APP_WEB_URL: ''
# File preview or download Url prefix.
# used to display File preview or download Url to the front-end or as Multi-model inputs;
# Url is signed and has expiration time.
FILES_URL: ''
# File Access Time specifies a time interval in seconds for the file to be accessed.
# The default value is 300 seconds.
FILES_ACCESS_TIMEOUT: 300
# When enabled, migrations will be executed prior to application startup and the application will start after the migrations have completed.
MIGRATION_ENABLED: 'true'
# The configurations of postgres database connection.
# It is consistent with the configuration in the 'db' service below.
DB_USERNAME: postgres
DB_PASSWORD: difyai123456
DB_HOST: db
DB_PORT: 5432
DB_DATABASE: dify
# The configurations of redis connection.
# It is consistent with the configuration in the 'redis' service below.
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_USERNAME: ''
REDIS_PASSWORD: difyai123456
REDIS_USE_SSL: 'false'
# use redis db 0 for redis cache
REDIS_DB: 0
# The configurations of celery broker.
# Use redis as the broker, and redis db 1 for celery broker.
CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
# Specifies the allowed origins for cross-origin requests to the Web API, e.g. https://dify.app or * for all origins.
WEB_API_CORS_ALLOW_ORIGINS: '*'
# Specifies the allowed origins for cross-origin requests to the console API, e.g. https://cloud.dify.ai or * for all origins.
CONSOLE_CORS_ALLOW_ORIGINS: '*'
# CSRF Cookie settings
# Controls whether a cookie is sent with cross-site requests,
# providing some protection against cross-site request forgery attacks
#
# Default: `SameSite=Lax, Secure=false, HttpOnly=true`
# This default configuration supports same-origin requests using either HTTP or HTTPS,
# but does not support cross-origin requests. It is suitable for local debugging purposes.
#
# If you want to enable cross-origin support,
# you must use the HTTPS protocol and set the configuration to `SameSite=None, Secure=true, HttpOnly=true`.
#
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: local
# The path to the local storage directory, the directory relative the root path of API service codes or absolute path. Default: `storage` or `/home/john/storage`.
# only available when STORAGE_TYPE is `local`.
STORAGE_LOCAL_PATH: storage
# The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
S3_ENDPOINT: 'https://xxx.r2.cloudflarestorage.com'
S3_BUCKET_NAME: 'difyai'
S3_ACCESS_KEY: 'ak-difyai'
S3_SECRET_KEY: 'sk-difyai'
S3_REGION: 'us-east-1'
# The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
AZURE_BLOB_ACCOUNT_NAME: 'difyai'
AZURE_BLOB_ACCOUNT_KEY: 'difyai'
AZURE_BLOB_CONTAINER_NAME: 'difyai-container'
AZURE_BLOB_ACCOUNT_URL: 'https://<your_account_name>.blob.core.windows.net'
# The Google storage configurations, only available when STORAGE_TYPE is `google-storage`.
GOOGLE_STORAGE_BUCKET_NAME: 'yout-bucket-name'
# if you want to use Application Default Credentials, you can leave GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 empty.
GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: 'your-google-service-account-json-base64-string'
# The type of vector store to use. Supported values are `weaviate`, `qdrant`, `milvus`, `relyt`.
VECTOR_STORE: weaviate
# The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
WEAVIATE_ENDPOINT: http://weaviate:8080
# The Weaviate API key.
WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
# The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
QDRANT_URL: http://qdrant:6333
# The Qdrant API key.
QDRANT_API_KEY: difyai123456
# The Qdrant client timeout setting.
QDRANT_CLIENT_TIMEOUT: 20
# The Qdrant client enable gRPC mode.
QDRANT_GRPC_ENABLED: 'false'
# The Qdrant server gRPC mode PORT.
QDRANT_GRPC_PORT: 6334
# Milvus configuration Only available when VECTOR_STORE is `milvus`.
# The milvus host.
MILVUS_HOST: 127.0.0.1
# The milvus host.
MILVUS_PORT: 19530
# The milvus username.
MILVUS_USER: root
# The milvus password.
MILVUS_PASSWORD: Milvus
# The milvus tls switch.
MILVUS_SECURE: 'false'
# relyt configurations
RELYT_HOST: db
RELYT_PORT: 5432
RELYT_USER: postgres
RELYT_PASSWORD: difyai123456
RELYT_DATABASE: postgres
# pgvector configurations
PGVECTOR_HOST: pgvector
PGVECTOR_PORT: 5432
PGVECTOR_USER: postgres
PGVECTOR_PASSWORD: difyai123456
PGVECTOR_DATABASE: dify
# Mail configuration, support: resend, smtp
MAIL_TYPE: ''
# default send from email address, if not specified
MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
SMTP_SERVER: ''
SMTP_PORT: 587
SMTP_USERNAME: ''
SMTP_PASSWORD: ''
SMTP_USE_TLS: 'true'
# the api-key for resend (https://resend.com)
RESEND_API_KEY: ''
RESEND_API_URL: https://api.resend.com
# The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
SENTRY_DSN: ''
# The sample rate for Sentry events. Default: `1.0`
SENTRY_TRACES_SAMPLE_RATE: 1.0
# The sample rate for Sentry profiles. Default: `1.0`
SENTRY_PROFILES_SAMPLE_RATE: 1.0
# Notion import configuration, support public and internal
NOTION_INTEGRATION_TYPE: public
NOTION_CLIENT_SECRET: you-client-secret
NOTION_CLIENT_ID: you-client-id
NOTION_INTERNAL_SECRET: you-internal-secret
# The sandbox service endpoint.
CODE_EXECUTION_ENDPOINT: "http://sandbox:8194"
CODE_EXECUTION_API_KEY: dify-sandbox
CODE_MAX_NUMBER: 9223372036854775807
CODE_MIN_NUMBER: -9223372036854775808
CODE_MAX_STRING_LENGTH: 80000
TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
CODE_MAX_STRING_ARRAY_LENGTH: 30
CODE_MAX_OBJECT_ARRAY_LENGTH: 30
CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
# SSRF Proxy server
SSRF_PROXY_HTTP_URL: 'http://ssrf_proxy:3128'
SSRF_PROXY_HTTPS_URL: 'http://ssrf_proxy:3128'
# Indexing configuration
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
depends_on:
- db
- redis
volumes:
# Mount the storage directory to the container, for storing user files.
- ./volumes/app/storage:/app/api/storage
# uncomment to expose dify-api port to host
# ports:
# - "5001:5001"
networks:
- ssrf_proxy_network
- default
接下来是对上述内容进行详细解释:
api:
image: langgenius/dify-api:0.6.9
使用名为 langgenius/dify-api
的 Docker 镜像,版本为 0.6.9
。
restart: always
确保容器在任何情况下(例如崩溃、系统重启等)都自动重启。
environment:
定义容器运行时的环境变量。
# Startup mode, 'api' starts the API server.
MODE: api
启动模式,设置为 api
启动 API 服务器。
# The log level for the application. Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
LOG_LEVEL: INFO
应用的日志级别,支持 DEBUG
、INFO
、WARNING
、ERROR
、CRITICAL
,这里设置为 INFO
。
# enable DEBUG mode to output more logs
# DEBUG : true
启用 DEBUG
模式以输出更多日志(目前被注释掉)。
# A secret key that is used for securely signing the session cookie and encrypting sensitive information on the database. You can generate a strong key using `openssl rand -base64 42`.
SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
用于安全签署会话 cookie 和加密数据库中的敏感信息的密钥。可以使用 openssl rand -base64 42
生成一个强密钥。
# The base URL of console application web frontend, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_WEB_URL: ''
控制台应用程序 Web 前端的基础 URL。如果控制台域名与 API 或 Web 应用域名不同,则指向 Web 服务的控制台基础 URL。
# Password for admin user initialization.
# If left unset, admin user will not be prompted for a password when creating the initial admin account.
INIT_PASSWORD: ''
管理员用户初始化密码。如果未设置,则在创建初始管理员账户时不会提示输入密码。
# The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_API_URL: ''
控制台应用程序 API 服务器的基础 URL。如果控制台域名与 API 或 Web 应用域名不同,则指向 Web 服务的控制台基础 URL。
# The URL prefix for Service API endpoints, refers to the base URL of the current API service if api domain is
# different from console domain.
# example: http://api.dify.ai
SERVICE_API_URL: ''
服务 API 端点的 URL 前缀。如果 API 域名与控制台域名不同,则指向当前 API 服务的基础 URL。
# The URL prefix for Web APP frontend, refers to the Web App base URL of WEB service if web app domain is different from
# console or api domain.
# example: http://udify.app
APP_WEB_URL: ''
Web 应用前端的 URL 前缀。如果 Web 应用域名与控制台或 API 域名不同,则指向 Web 服务的 Web 应用基础 URL。
# File preview or download Url prefix.
# used to display File preview or download Url to the front-end or as Multi-model inputs;
# Url is signed and has expiration time.
FILES_URL: ''
文件预览或下载 URL 前缀。用于向前端显示文件预览或下载 URL,或者作为多模型输入;URL 是签名的并具有过期时间。
# File Access Time specifies a time interval in seconds for the file to be accessed.
# The default value is 300 seconds.
FILES_ACCESS_TIMEOUT: 300
文件访问时间,指定文件可访问的时间间隔(以秒为单位)。默认值为 300 秒。
# When enabled, migrations will be executed prior to application startup and the application will start after the migrations have completed.
MIGRATION_ENABLED: 'true'
启用后,在应用程序启动前执行迁移,迁移完成后应用程序才会启动。
# The configurations of postgres database connection.
# It is consistent with the configuration in the 'db' service below.
DB_USERNAME: postgres
DB_PASSWORD: difyai123456
DB_HOST: db
DB_PORT: 5432
DB_DATABASE: dify
Postgres 数据库连接的配置。与下面 db
服务中的配置一致。
-
DB_USERNAME
:数据库用户名 -
DB_PASSWORD
:数据库密码 -
DB_HOST
:数据库主机名 -
DB_PORT
:数据库端口 -
DB_DATABASE
:数据库名称
# The configurations of redis connection.
# It is consistent with the configuration in the 'redis' service below.
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_USERNAME: ''
REDIS_PASSWORD: difyai123456
REDIS_USE_SSL: 'false'
Redis 连接的配置。与下面 redis
服务中的配置一致。
-
REDIS_HOST
:Redis 主机名 -
REDIS_PORT
:Redis 端口 -
REDIS_USERNAME
:Redis 用户名 -
REDIS_PASSWORD
:Redis 密码 -
REDIS_USE_SSL
:是否使用 SSL
# use redis db 0 for redis cache
REDIS_DB: 0
使用 Redis 数据库 0 作为缓存。
# The configurations of celery broker.
# Use redis as the broker, and redis db 1 for celery broker.
CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
Celery broker 的配置。使用 Redis 作为 broker,并使用 Redis 数据库 1。
# Specifies the allowed origins for cross-origin requests to the Web API, e.g. https://dify.app or * for all origins.
WEB_API_CORS_ALLOW_ORIGINS: '*'
指定允许跨域请求 Web API 的来源,例如 https://dify.app
或 *
代表所有来源。
# Specifies the allowed origins for cross-origin requests to the console API, e.g. https://cloud.dify.ai or * for all origins.
CONSOLE_CORS_ALLOW_ORIGINS: '*'
指定允许跨域请求控制台 API 的来源,例如 https://cloud.dify.ai
或 *
代表所有来源。
# CSRF Cookie settings
# Controls whether a cookie is sent with cross-site requests,
# providing some protection against cross-site request forgery attacks
#
# Default: `SameSite=Lax, Secure=false, HttpOnly=true`
# This default configuration supports same-origin requests using either HTTP or HTTPS,
# but does not support cross-origin requests. It is suitable for local debugging purposes.
#
# If you want to enable cross-origin support,
# you must use the HTTPS protocol and set the configuration to `SameSite=None, Secure=true, HttpOnly=true`.
#
CSRF Cookie 设置,控制是否在跨站请求时发送 Cookie,提供一些防护以防止跨站请求伪造攻击。
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: local
用于存储用户文件的存储类型。支持的值有 local
、s3
、azure-blob
和 google-storage
,默认值为 local
。
# The path to the local storage directory, the directory relative the root path of API service codes or absolute path. Default: `storage` or `/home/john/storage`.
# only available when STORAGE_TYPE is `local`.
STORAGE_LOCAL_PATH: storage
本地存储目录的路径,相对于 API 服务代码的根路径或绝对路径。默认值为 storage
或 /home/john/storage
。仅在 STORAGE_TYPE
为 local
时可用。
# The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
S3_ENDPOINT: 'https://xxx.r2.cloudflarestorage.com'
S3_BUCKET_NAME: 'difyai'
S3_ACCESS_KEY: 'ak-difyai'
S3_SECRET_KEY: 'sk-difyai'
S3_REGION: 'us-east-1'
S3 存储配置,仅在 STORAGE_TYPE
为 s3
时可用。
-
S3_ENDPOINT
:S3 端点 URL -
S3_BUCKET_NAME
:S3 存储桶名称 -
S3_ACCESS_KEY
:S3
S3_ACCESS_KEY: 'ak-difyai'
S3 访问密钥。
S3_SECRET_KEY: 'sk-difyai'
S3 密钥。
S3_REGION: 'us-east-1'
S3 存储区域。
# The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
AZURE_BLOB_ACCOUNT_NAME: 'difyai'
AZURE_BLOB_ACCOUNT_KEY: 'difyai'
AZURE_BLOB_CONTAINER_NAME: 'difyai-container'
AZURE_BLOB_ACCOUNT_URL: 'https://<your_account_name>.blob.core.windows.net'
Azure Blob 存储配置,仅在 STORAGE_TYPE
为 azure-blob
时可用。
-
AZURE_BLOB_ACCOUNT_NAME
:Azure Blob 存储账户名称。 -
AZURE_BLOB_ACCOUNT_KEY
:Azure Blob 存储账户密钥。 -
AZURE_BLOB_CONTAINER_NAME
:Azure Blob 容器名称。 -
AZURE_BLOB_ACCOUNT_URL
:Azure Blob 存储账户 URL。
# The Google storage configurations, only available when STORAGE_TYPE is `google-storage`.
GOOGLE_STORAGE_BUCKET_NAME: 'your-bucket-name'
# if you want to use Application Default Credentials, you can leave GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 empty.
GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: 'your-google-service-account-json-base64-string'
Google 存储配置,仅在 STORAGE_TYPE
为 google-storage
时可用。
-
GOOGLE_STORAGE_BUCKET_NAME
:Google 存储桶名称。 -
GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64
:Google 服务账户 JSON 的 base64 编码字符串。如果要使用应用默认凭据,可以将其留空。
# The type of vector store to use. Supported values are `weaviate`, `qdrant`, `milvus`, `relyt`.
VECTOR_STORE: weaviate
向量存储类型。支持的值有 weaviate
、qdrant
、milvus
和 relyt
。
# The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
WEAVIATE_ENDPOINT: http://weaviate:8080
# The Weaviate API key.
WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
Weaviate 配置,仅在 VECTOR_STORE
为 weaviate
时可用。
-
WEAVIATE_ENDPOINT
:Weaviate 端点 URL。 -
WEAVIATE_API_KEY
:Weaviate API 密钥。
# The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
QDRANT_URL: http://qdrant:6333
# The Qdrant API key.
QDRANT_API_KEY: difyai123456
# The Qdrant client timeout setting.
QDRANT_CLIENT_TIMEOUT: 20
# The Qdrant client enable gRPC mode.
QDRANT_GRPC_ENABLED: 'false'
# The Qdrant server gRPC mode PORT.
QDRANT_GRPC_PORT: 6334
Qdrant 配置,仅在 VECTOR_STORE
为 qdrant
时可用。
-
QDRANT_URL
:Qdrant 端点 URL。 -
QDRANT_API_KEY
:Qdrant API 密钥。 -
QDRANT_CLIENT_TIMEOUT
:Qdrant 客户端超时设置。 -
QDRANT_GRPC_ENABLED
:启用 gRPC 模式。 -
QDRANT_GRPC_PORT
:Qdrant gRPC 服务器端口。
# Milvus configuration Only available when VECTOR_STORE is `milvus`.
# The milvus host.
MILVUS_HOST: 127.0.0.1
# The milvus port.
MILVUS_PORT: 19530
# The milvus username.
MILVUS_USER: root
# The milvus password.
MILVUS_PASSWORD: Milvus
# The milvus tls switch.
MILVUS_SECURE: 'false'
Milvus 配置,仅在 VECTOR_STORE
为 milvus
时可用。
-
MILVUS_HOST
:Milvus 主机。 -
MILVUS_PORT
:Milvus 端口。 -
MILVUS_USER
:Milvus 用户名。 -
MILVUS_PASSWORD
:Milvus 密码。 -
MILVUS_SECURE
:是否启用 TLS。
# relyt configurations
RELYT_HOST: db
RELYT_PORT: 5432
RELYT_USER: postgres
RELYT_PASSWORD: difyai123456
RELYT_DATABASE: postgres
Relyt 配置。
-
RELYT_HOST
:Relyt 主机。 -
RELYT_PORT
:Relyt 端口。 -
RELYT_USER
:Relyt 用户名。 -
RELYT_PASSWORD
:Relyt 密码。 -
RELYT_DATABASE
:Relyt 数据库名称。
# pgvector configurations
PGVECTOR_HOST: pgvector
PGVECTOR_PORT: 5432
PGVECTOR_USER: postgres
PGVECTOR_PASSWORD: difyai123456
PGVECTOR_DATABASE: dify
Pgvector 配置。
-
PGVECTOR_HOST
:Pgvector 主机。 -
PGVECTOR_PORT
:Pgvector 端口。 -
PGVECTOR_USER
:Pgvector 用户名。 -
PGVECTOR_PASSWORD
:Pgvector 密码。 -
PGVECTOR_DATABASE
:Pgvector 数据库名称。
# Mail configuration, support: resend, smtp
MAIL_TYPE: ''
# default send from email address, if not specified
MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
SMTP_SERVER: ''
SMTP_PORT: 587
SMTP_USERNAME: ''
SMTP_PASSWORD: ''
SMTP_USE_TLS: 'true'
邮件配置,支持 resend
和 smtp
。
-
MAIL_TYPE
:邮件类型。 -
MAIL_DEFAULT_SEND_FROM
:默认发送电子邮件的地址。 -
SMTP_SERVER
:SMTP 服务器。 -
SMTP_PORT
:SMTP 端口。 -
SMTP_USERNAME
:SMTP 用户名。 -
SMTP_PASSWORD
:SMTP 密码。 -
SMTP_USE_TLS
:是否使用 TLS。
# the api-key for resend (https://resend.com)
RESEND_API_KEY: ''
RESEND_API_URL: https://api.resend.com
Resend 配置。
-
RESEND_API_KEY
:Resend API 密钥。 -
RESEND_API_URL
:Resend API URL。
# The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
SENTRY_DSN: ''
# The sample rate for Sentry events. Default: `1.0`
SENTRY_TRACES_SAMPLE_RATE: 1.0
# The sample rate for Sentry profiles. Default: `1.0`
SENTRY_PROFILES_SAMPLE_RATE: 1.0
Sentry 错误报告配置。
-
SENTRY_DSN
:Sentry 数据源名称。如果未设置,则禁用 Sentry 错误报告。 -
SENTRY_TRACES_SAMPLE_RATE
:Sentry 事件的采样率。默认值为1.0
。 -
SENTRY_PROFILES_SAMPLE_RATE
:Sentry 配置文件的采样率。默认值为1.0
。
# Notion import configuration, support public and internal
NOTION_INTEGRATION_TYPE: public
NOTION_CLIENT_SECRET: you-client-secret
NOTION_CLIENT_ID: you-client-id
NOTION_INTERNAL_SECRET: you-internal-secret
Notion 导入配置,支持 public
和 internal
。
-
NOTION_INTEGRATION_TYPE
:Notion 集成类型。 -
NOTION_CLIENT_SECRET
:Notion 客户端密钥。 -
NOTION_CLIENT_ID
:Notion 客户端 ID。 -
NOTION_INTERNAL_SECRET
:Notion 内部密钥。
# The sandbox service endpoint.
CODE_EXECUTION_ENDPOINT: "http://sandbox:8194"
CODE_EXECUTION_API_KEY: dify-sandbox
CODE_MAX_NUMBER: 9223372036854775807
CODE_MIN_NUMBER: -9223372036854775808
CODE_MAX_STRING_LENGTH: 80000
TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
CODE_MAX_STRING_ARRAY_LENGTH: 30
CODE_MAX_OBJECT_ARRAY_LENGTH: 30
CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
沙箱服务配置。
-
CODE_EXECUTION_ENDPOINT
:沙箱服务端点。 -
CODE_EXECUTION_API_KEY
:沙箱服务 API 密钥。 -
CODE_MAX_NUMBER
:代码最大数值。 -
CODE_MIN_NUMBER
:代码最小数值。 -
CODE_MAX_STRING_LENGTH
:代码最大字符串
CODE_MAX_STRING_LENGTH: 80000
代码最大字符串长度。
TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
模板转换的最大长度。
CODE_MAX_STRING_ARRAY_LENGTH: 30
代码最大字符串数组长度。
CODE_MAX_OBJECT_ARRAY_LENGTH: 30
代码最大对象数组长度。
CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
代码最大数值数组长度。
# SSRF Proxy server
SSRF_PROXY_HTTP_URL: 'http://ssrf_proxy:3128'
SSRF_PROXY_HTTPS_URL: 'http://ssrf_proxy:3128'
SSRF 代理服务器配置。
-
SSRF_PROXY_HTTP_URL
:SSRF 代理 HTTP URL。 -
SSRF_PROXY_HTTPS_URL
:SSRF 代理 HTTPS URL。
# Indexing configuration
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
索引配置。
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH
:索引最大分段令牌长度。
depends_on:
- db
- redis
依赖项配置,指定此服务依赖于 db
和 redis
服务。
volumes:
# Mount the storage directory to the container, for storing user files.
- ./volumes/app/storage:/app/api/storage
卷配置,将本地目录 ./volumes/app/storage
挂载到容器中的 /app/api/storage
目录,用于存储用户文件。
# uncomment to expose dify-api port to host
# ports:
# - "5001:5001"
端口配置,取消注释以将 dify-api 端口暴露给主机。
ports
:指定端口映射,例如"5001:5001"
。
networks:
- ssrf_proxy_network
- default
网络配置,指定此服务连接到 ssrf_proxy_network
和 default
网络。