Dify
This service deploys Dify, an LLM app development platform that combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more.
Services
dify-api: API service for Difydify-worker: Background worker for async tasksdify-web: Web frontend interfacedify-db: PostgreSQL databasedify-redis: Redis cachedify-weaviate: Weaviate vector database (optional profile)
Environment Variables
| Variable Name | Description | Default Value |
|---|---|---|
| DIFY_VERSION | Dify image version | 0.18.2 |
| POSTGRES_USER | PostgreSQL username | dify |
| POSTGRES_PASSWORD | PostgreSQL password | difypass |
| POSTGRES_DB | PostgreSQL database name | dify |
| REDIS_PASSWORD | Redis password (empty for no auth) | "" |
| SECRET_KEY | Secret key for encryption | (auto) |
| LOG_LEVEL | Log level | INFO |
| DIFY_PORT_OVERRIDE | Host port mapping for web interface | 3000 |
| STORAGE_TYPE | Storage type (local, s3, azure-blob, etc.) | local |
| VECTOR_STORE | Vector store type (weaviate, milvus, etc.) | weaviate |
| WEAVIATE_VERSION | Weaviate version (if using weaviate) | 1.28.12 |
Please modify the .env file as needed for your use case.
Volumes
dify_storage: Storage for uploaded files and generated contentdify_db_data: PostgreSQL datadify_redis_data: Redis persistence datadify_weaviate_data: Weaviate vector database data
Usage
Start Dify with Weaviate
docker compose --profile weaviate up -d
Start Dify without Vector Database
docker compose up -d
Access
- Web Interface: http://localhost:3000
- API Docs: http://localhost:5001/docs
First Time Setup
- Open http://localhost:3000
- Create an admin account
- Configure your LLM API keys (OpenAI, Azure OpenAI, Anthropic, etc.)
- Start creating your AI applications
Notes
- First startup may take a few minutes for database initialization
- Change
SECRET_KEYin production for security - For production deployment, consider using external PostgreSQL and Redis
- Supports multiple LLM providers: OpenAI, Azure OpenAI, Anthropic, Google, local models via Ollama, etc.
- Vector database is optional but recommended for RAG capabilities
Security
- Change default passwords in production
- Use strong
SECRET_KEY - Enable authentication on Redis in production
- Consider using TLS for API connections in production
License
Dify is licensed under Apache License 2.0. See Dify GitHub for more information.