mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 11:18:19 +08:00
3.4 KiB
3.4 KiB
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
.env
file, 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_STORE
environment variable in your.env
file. - Mandatory .env File: A
.env
file 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-legacy
directory 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
docker
directory. - Copy the
.env.example
file to a new file named.env
by runningcp .env.example .env
. - Customize the
.env
file as needed. Refer to the.env.example
file for detailed configuration options.
- Navigate to the
- Running the Services:
- Execute
docker compose up
from thedocker
directory to start the services. - To specify a vector database, set the
VECTOR_store
variable in your.env
file 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.yaml
for setting up essential middleware services like databases and caches. - Navigate to the
docker
directory. - Ensure the
middleware.env
file is created by runningcp middleware.env.example middleware.env
(refer to themiddleware.env.example
file).
- Use the
- Running Middleware Services:
- Execute
docker-compose -f docker-compose.middleware.yaml up -d
to start the middleware services.
- Execute
Migration for Existing Users
For users migrating from the docker-legacy
setup:
- Review Changes: Familiarize yourself with the new
.env
configuration 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.env
file 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.example
file and the Docker Compose configuration files in thedocker
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.