This directory contains production-grade Docker assets for the EstateWise monorepo.
flowchart LR
User((User)) -->|HTTP| Nginx[Nginx :80]
Nginx --> Frontend[Next.js :3000]
Nginx --> Backend[API :3001]
Backend --> Mongo[(MongoDB)]
Backend --> Pinecone[(Pinecone)]
Backend --> Neo4j[(Neo4j)]
Agentic[Agentic AI :4318] --> MCP[MCP Server]
MCP --> Backend
MCP --> Frontend
compose.prod.yml: Full-stack production compose for Docker (frontend, backend, nginx, mongo; optional neo4j).podman-compose.prod.yml: Equivalent full-stack compose for Podman (same services, noversionkey).backend.Dockerfile: Multi-stage backend image with healthcheck.frontend.Dockerfile: Multi-stage Next.js image with healthcheck.agentic-ai.Dockerfile: Multi-stage Agentic AI + MCP image with healthcheck.nginx/: Reverse proxy that routes/api+/trpcto the backend and all other traffic to the frontend.
- Docker + Docker Compose (v2+), or Podman (4.1+) with
podman-composeor thepodman composeplugin. - A root
.envfile based on/.env.example.
-
Create and edit your root
.env:- Copy
/.env.exampleto/.envand fill in real values. - At minimum, set
MONGO_URI,JWT_SECRET,GOOGLE_AI_API_KEY,PINECONE_API_KEY,PINECONE_INDEX.
- Copy
-
Build and run:
# Docker docker compose -f docker/compose.prod.yml --env-file .env up --build -d # Podman podman compose -f docker/podman-compose.prod.yml --env-file .env up --build -d
-
Access:
- App:
http://localhost - API docs:
http://localhost/api-docs - Metrics:
http://localhost/metrics
- App:
sequenceDiagram
participant Browser
participant Nginx
participant Frontend
participant Backend
participant Mongo
Browser->>Nginx: GET /
Nginx->>Frontend: Proxy to Next.js
Browser->>Nginx: POST /api/chat
Nginx->>Backend: Proxy to API
Backend->>Mongo: Query/Write
Backend-->>Browser: JSON response
| Service | Port | Internal | Healthcheck |
|---|---|---|---|
| Nginx | 80 |
80 |
N/A |
| Frontend | N/A | 3000 |
GET / |
| Backend | N/A | 3001 |
GET /metrics |
| Agentic AI | 4318 (optional) |
4318 |
GET /health |
| Mongo | N/A | 27017 |
mongosh ping |
| Neo4j | 7474/7687 (optional) |
7474/7687 |
N/A |
Minimum variables for core stack (in .env):
MONGO_URI,JWT_SECRET,GOOGLE_AI_API_KEY,PINECONE_API_KEY,PINECONE_INDEX
Optional variables:
OPENAI_API_KEY,NEO4J_*,GOOGLE_AI_MODEL,OPENAI_MODELNEXT_PUBLIC_API_BASE_URL(frontend build-time)API_BASE_URL,FRONTEND_BASE_URL(MCP defaults for agentic)NGINX_PORT,AGENTIC_PORT,NEO4J_HTTP_PORT,NEO4J_BOLT_PORT
flowchart TB
subgraph Profiles
Core[default] --> Mongo
Core --> Backend
Core --> Frontend
Core --> Nginx
Core -. optional .-> Agentic
Core -. optional .-> Neo4j
end
Enable the Neo4j container via profile and update the .env values:
# Docker
docker compose -f docker/compose.prod.yml --profile graph --env-file .env up -d
# Podman
podman compose -f docker/podman-compose.prod.yml --profile graph --env-file .env up -dEnable the Agentic AI HTTP server via profile:
# Docker
docker compose -f docker/compose.prod.yml --profile agentic --env-file .env up -d
# Podman
podman compose -f docker/podman-compose.prod.yml --profile agentic --env-file .env up -dThen call POST /run on http://localhost:4318 with { goal, runtime?, rounds?, threadId? }.
Ensure your .env provides at least one of GOOGLE_AI_API_KEY or OPENAI_API_KEY, plus
any Pinecone/Neo4j settings you plan to use in tools.
sequenceDiagram
participant Client
participant Agentic
participant MCP
participant Backend
Client->>Agentic: POST /run {goal, runtime}
Agentic->>MCP: Tool calls
MCP->>Backend: API requests
Backend-->>MCP: JSON data
MCP-->>Agentic: Tool results
Agentic-->>Client: Report/summary
mongoruns locally by default and backs the backend viamongodb://mongo:27017/estatewise.- If you use an external MongoDB, set
MONGO_URIaccordingly and remove/disable themongoservice. - The frontend currently hardcodes the backend URL in
frontend/lib/api.tsandfrontend/pages/chat.tsx. For a fully self-contained Docker deployment, update those to read fromprocess.env.NEXT_PUBLIC_API_BASE_URL(or use relative/apipaths) soNEXT_PUBLIC_API_BASE_URL=http://localhostcan be injected at build time.
- Healthchecks are baked into backend, frontend, and agentic images.
- Use
docker compose logs -f backend(orpodman compose logs -f backend) to inspect API startup and Mongo connectivity. - For production TLS, terminate HTTPS in front of Nginx (load balancer or managed ingress).
- Scale backend/agentic with replicas behind Nginx if needed (external orchestrator required).
# Docker
docker compose -f docker/compose.prod.yml down
# Podman
podman compose -f docker/podman-compose.prod.yml downTo remove all containers, networks, and volumes created by the compose file:
# Docker
docker compose -f docker/compose.prod.yml down -v
# Podman
podman compose -f docker/podman-compose.prod.yml down -v- Podman 4.1+ is required for BuildKit-style
--mount=type=cachedirectives in the Dockerfiles. - Podman reads
Dockerfilenatively — noContainerfilesymlinks are needed. .containerignorefiles are included alongside.dockerignorefor Podman tooling that checks for them.- If you hit permission issues with rootless Podman, add
:Zto volume mounts for SELinux relabeling (e.g.,./logs:/var/log/mcp:Z). podman-compose(PyPI) and the built-inpodman composeplugin both work. The plugin ships with Podman 4.7+.
For more advanced setups (e.g., Kubernetes, cloud deployments), refer to the respective documentation in the repository.