Welcome to the new docker
directory for deploying Dify using Docker Compose. This README outlines the updates, deployment instructions, and migration details for existing users.
Certbot Container: docker-compose.yaml
now contains certbot
for managing SSL certificates. This container automatically renews certificates and ensures secure HTTPS connections.
For more information, refer docker/certbot/README.md
.
Persistent Environment Variables: Environment variables are now managed through a .env
file, ensuring that your configurations persist across deployments.
What is
.env
?
The.env
file is a crucial component in Docker and Docker Compose environments, serving as a centralized configuration file where you can define environment variables that are accessible to the containers at runtime. This file simplifies the management of environment settings across different stages of development, testing, and production, providing consistency and ease of configuration to deployments.
Unified Vector Database Services: All vector database services are now managed from a single Docker Compose file docker-compose.yaml
. You can switch between different vector databases by setting the VECTOR_STORE
environment variable in your .env
file.
Mandatory .env File: A .env
file is now required to run docker compose up
. This file is crucial for configuring your deployment and for any custom settings to persist through upgrades.
docker-compose.yaml
docker
directory..env.example
file to a new file named .env
by running cp .env.example .env
..env
file as needed. Refer to the .env.example
file for detailed configuration options.docker compose up
from the docker
directory to start the services.VECTOR_STORE
variable in your .env
file to your desired vector database service, such as milvus
, weaviate
, or opensearch
.docker/certbot/README.md
to set up SSL certificates using Certbot.ENABLE_OTEL
to true
in .env
.OTLP_BASE_ENDPOINT
properly.docker-compose.middleware.yaml
for setting up essential middleware services like databases and caches.docker
directory.middleware.env
file is created by running cp middleware.env.example middleware.env
(refer to the middleware.env.example
file).docker
directory.docker compose -f docker-compose.middleware.yaml --profile weaviate -p dify up -d
to start the middleware services. (Change the profile to other vector database if you are not using weaviate)For users migrating from the docker-legacy
setup:
.env
configuration and Docker Compose setup.docker-compose.yaml
, ssrf_proxy/squid.conf
, or nginx/conf.d/default.conf
, you will need to reflect these changes in the .env
file you create..env
VECTOR_STORE
), users can set specific endpoints, ports, and authentication details.STORAGE_TYPE
), users can configure specific settings for S3, Azure Blob, Google Storage, etc.The .env.example
file provided in the Docker setup is extensive and covers a wide range of configuration options. It is structured into several sections, each pertaining to different aspects of the application and its services. Here are some of the key sections and variables:
Common Variables:
CONSOLE_API_URL
, SERVICE_API_URL
: URLs for different API services.APP_WEB_URL
: Frontend application URL.FILES_URL
: Base URL for file downloads and previews.Server Configuration:
LOG_LEVEL
, DEBUG
, FLASK_DEBUG
: Logging and debug settings.SECRET_KEY
: A key for encrypting session cookies and other sensitive data.Database Configuration:
DB_USERNAME
, DB_PASSWORD
, DB_HOST
, DB_PORT
, DB_DATABASE
: PostgreSQL database credentials and connection details.Redis Configuration:
REDIS_HOST
, REDIS_PORT
, REDIS_PASSWORD
: Redis server connection settings.Celery Configuration:
CELERY_BROKER_URL
: Configuration for Celery message broker.Storage Configuration:
STORAGE_TYPE
, S3_BUCKET_NAME
, AZURE_BLOB_ACCOUNT_NAME
: Settings for file storage options like local, S3, Azure Blob, etc.Vector Database Configuration:
VECTOR_STORE
: Type of vector database (e.g., weaviate
, milvus
).WEAVIATE_ENDPOINT
, MILVUS_URI
.CORS Configuration:
WEB_API_CORS_ALLOW_ORIGINS
, CONSOLE_CORS_ALLOW_ORIGINS
: Settings for cross-origin resource sharing.OpenTelemetry Configuration:
ENABLE_OTEL
: Enable OpenTelemetry collector in api.OTLP_BASE_ENDPOINT
: Endpoint for your OTLP exporter.Other Service-Specific Environment Variables:
nginx
, redis
, db
, and vector databases have specific environment variables that are directly referenced in the docker-compose.yaml
..env.example
file and the Docker Compose configuration files in the docker
directory.This README aims to guide you through the deployment process using the new Docker Compose setup. For any issues or further assistance, please refer to the official documentation or contact support.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。