mirror of
https://github.com/langgenius/dify.git
synced 2025-10-29 09:59:38 +00:00
README for docker Deployment
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.
What's Updated
- Persistent Environment Variables: Environment variables are now managed through a
.envfile, ensuring that your configurations persist across 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 theVECTOR_STOREenvironment variable in your.envfile. - Mandatory .env File: A
.envfile is now required to rundocker compose up. This file is crucial for configuring your deployment and for any custom settings to persist through upgrades. - Legacy Support: Previous deployment files are now located in the
docker-legacydirectory and will no longer be maintained.
How to Deploy Dify with docker-compose.yaml
- Prerequisites: Ensure Docker and Docker Compose are installed on your system.
- Environment Setup:
- Navigate to the
dockerdirectory. - Copy the
.env.examplefile to a new file named.envby runningcp .env.example .env. - Customize the
.envfile as needed. Refer to the.env.examplefile for detailed configuration options.
- Navigate to the
- Running the Services:
- Execute
docker compose upfrom thedockerdirectory to start the services. - To specify a vector database, set the
VECTOR_storevariable in your.envfile to your desired vector database service, such asmilvus,weaviate, oropensearch.
- Execute
How to Deploy Middleware for Developing Dify
- Middleware Setup:
- Use the
docker-compose.middleware.yamlfor setting up essential middleware services like databases and caches. - Navigate to the
dockerdirectory. - Ensure the
middleware.envfile is created by runningcp middleware.env.example middleware.env(refer to themiddleware.env.examplefile).
- Use the
- Running Middleware Services:
- Execute
docker-compose -f docker-compose.middleware.yaml up -dto start the middleware services.
- Execute
Migration for Existing Users
For users migrating from the docker-legacy setup:
- Review Changes: Familiarize yourself with the new
.envconfiguration and Docker Compose setup. - Transfer Customizations:
- If you have customized configurations such as
docker-compose.yaml,ssrf_proxy/squid.conf, ornginx/conf.d/default.conf, you will need to reflect these changes in the.envfile you create.
- If you have customized configurations such as
- Data Migration:
- Ensure that data from services like databases and caches is backed up and migrated appropriately to the new structure if necessary.
Additional Information
- Continuous Improvement Phase: We are actively seeking feedback from the community to refine and enhance the deployment process. As more users adopt this new method, we will continue to make improvements based on your experiences and suggestions.
- Support: For detailed configuration options and environment variable settings, refer to the
.env.examplefile and the Docker Compose configuration files in thedockerdirectory.
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.