The Problem — Dify Is Easy. The Infrastructure Around It Isn't.
You want to build LLM applications with Dify — but provisioning PostgreSQL, Redis, Weaviate, and Nginx from scratch is hours of work. The official docker-compose.yml gets you started, but it's not tuned for production. No persistent PostgreSQL config. No backup strategy. No TLS termination. No SSRF protection.
So you either run Dify in a way that'll break when you look away, or you spend an afternoon wiring up the supporting services yourself. Neither option is good.
What This Stack Does For You
Deploy a complete, production-ready Dify stack in 2 minutes instead of 2 hours. PostgreSQL persistence, Redis-backed Celery queue, Weaviate vector store, and Nginx reverse proxy — all pre-configured and wired together for building LLM applications.
What You'll Be Able To Do After Deploying
- Build LLM applications with confidence — Dify API, Worker, and Web UI running with PostgreSQL persistence so your apps, datasets, and user data survive container restarts
- Process background tasks reliably — Redis-backed Celery queue ensures long-running LLM operations don't block the web UI or time out
- Store and search embeddings at scale — Weaviate vector store pre-connected to Dify for RAG pipelines, semantic search, and agent memory
- Serve securely behind Nginx — Reverse proxy with TLS termination and security headers so your Dify instance is production-ready from day one
- Prevent SSRF attacks — Built-in SSRF proxy isolates outbound requests from your Dify workflows
- Run untrusted code safely — Sandbox environment for executing AI-generated code without risk to your host
Why This Saves You Hours
Setting up Dify for production means:
- Infrastructure wiring: PostgreSQL initialization, Redis configuration, Weaviate setup, Nginx config — each one needs research and testing
- Security hardening: SSRF prevention, sandboxing, TLS termination, security headers — easy to forget, costly to skip
- Missing pieces: The official Compose file gets Dify running but not production-ready. You'll discover the gaps when something breaks
This stack gives you all 9 services with a single docker compose up. Skip the infrastructure work, start building LLM applications.
What You Get
- docker-compose.yml — 9 services: Dify API, Worker, Web UI, PostgreSQL, Redis, Weaviate, Nginx, SSRF Proxy, Sandbox
- Nginx config — Reverse proxy with TLS termination and security headers
- PostgreSQL init script — UUID and pgcrypto extensions
- .env.example — All environment variables documented
- README.md — Architecture diagram, quick start, production checklist
Requirements
- Docker Engine 24+ with Docker Compose v2
- 4GB RAM minimum, 8GB recommended
- 10GB free disk space (for models and embeddings)
Your Outcome
2 minutes from now, you'll have a production-ready Dify stack running — with PostgreSQL persistence, Redis queues, Weaviate vector search, Nginx reverse proxy, SSRF protection, and a sandbox for code execution. Start building LLM applications immediately. No debugging, no infrastructure wiring.