Back openDesk Edu for a sovereign, open-source education β every vote counts.
Vote nowYour Outcome
Production-ready Dify with PostgreSQL, Redis, Weaviate, Nginx, and SSRF protection β not a toy compose file.
The information, code snippets, configuration files, and instructions provided in this product are shared for educational and informational purposes only. While every effort has been made to ensure accuracy, you are solely responsible for reviewing, testing, and adapting any code or configurations to your own environment before using them in production.
No liability: The author(s) shall not be held liable for any damages, data loss, system outages, security breaches, or other issues arising from the use, misuse, or inability to use the code, configurations, or instructions provided in this product. By downloading or using this product, you acknowledge that you understand and accept these terms.
Production Ansible deployment for two DGX Spark (GB10) nodes with vLLM TP2 serving DeepSeek-V4-Flash (671B), fronted by LiteLLM, monitored by Prometheus/Grafana, and wired over 200Gbps RoCE. The reference deployment for our Dual DGX Spark case study.
Run your own AI inference with Ollama, Open WebUI, and LiteLLM β production-hardened with Nginx, health checks, and backup.
Your RAG pipeline works on three example documents. The chat interface is beautiful. You feel productive.
Then you push it to production and:
The official docker-compose.yaml from Dify's repo is a starting point. It's not production infrastructure.
Every Dify deployment has the same nine services. The difference is in the tuning:
| Component | Official Compose | This Stack |
|-----------|----------------|------------|
| PostgreSQL | shared_buffers=128MB, default autovacuum | Tuned for RAG: shared_buffers=2GB, aggressive autovacuum, WAL compression |
| Redis | No persistence, no memory limit | AOF persistence + RDB, maxmemory 1gb, allkeys-lru eviction |
| Weaviate | No resource limits | Memory-capped, graceful degradation under load |
| Nginx | Not included | TLS termination, /api routing, WebSocket upgrade, security headers |
| SSRF Proxy | Mentioned in docs, not configured | Sandbox service with egress rules isolating outbound requests |
| Sandbox | SQLite (not production-safe) | Configured with proper isolation and resource limits |
| Health checks | Not included | Automated verification of all 9 services + inter-service connectivity |
| Backups | Not included | Hot backup: PostgreSQL pg_dump, Redis RDB, Weaviate snapshot |
| Upgrade path | Not documented | Step-by-step migration commands per Dify version |
Not the files. You can write a compose file. You're buying the tuning decisions that took months of production incidents to discover:
shared_buffers should be 25% of RAM on RAG workloads (not the default 128MB)appendonly yes because Celery tasks are lost without itThese are the things you learn by running Dify in production and watching it break. This stack encodes those lessons so you don't have to.
ββββββββββββ
HTTPS :443 β Nginx β
ββββββββββββββββββΊ :80 ββββββββββββΊ Dify Web :3000
ββββββββββββ
β
ββββββ΄βββββ
β Dify β
β API ββββΊ PostgreSQL :5432 (tuned)
β :5001 ββββΊ Redis :6379 (AOF persisted)
βββββββββββββββΊ Weaviate :8080 (memory-capped)
β
ββββββ΄βββββ
β Dify β
β Worker ββββΊ Sandbox :8194 (SSRF-isolated)
βββββββββββ
unzip dify-stack.zip
cd dify-stack
cp .env.example .env
# Edit: domain, DB password, secret keys
docker compose up -d
./health-check.sh
Dify is live at https://your-domain.com. Create an admin account and start building.
"Hey team, someone found our internal Docker network through Dify's web browsing tool. They downloaded /etc/shadow and posted it to a forum."
If you deployed Dify without the SSRF proxy, this is a real incident waiting to happen. With this stack, the Sandbox service isolates outbound requests to approved destinations. The internal Docker network is invisible to Dify's web browsing tool.
You can piece this together yourself from Dify's docs, PostgreSQL docs, Redis docs, Weaviate docs, Nginx docs, and SSRF prevention guides. Budget 2β3 full days for a senior engineer to configure, test, and document. At β¬600/day, that's β¬1,200β1,800 of engineering time.
Or download this stack, edit one .env file, and have it running in 20 minutes. β¬12.99.
Running Dify alone? Add Ollama for local LLM inference, n8n for workflow automation, Qdrant as an alternative vector store, Prometheus/Grafana for monitoring, MinIO for backups, and Traefik as your reverse proxy β AI Infrastructure Mastery includes this stack plus six more components for β¬29.