Spaces:
Build error
AmaniQuery Render Deployment Guide
This guide details the steps to deploy the AmaniQuery monorepo components to Render.com.
Prerequisites
- GitHub Repository: Ensure your code is pushed to a GitHub repository connected to Render.
- Docker, Node.js, and Go knowledge.
- Render Account: Created and ready.
1. Database & Infrastructure (Render Postgres & Redis)
Before deploying services, set up your managed data stores.
PostgreSQL
- Type: PostgreSQL
- Name:
amaniquery-db - Region: Frankfurt (EU-Central) or nearest.
- Environment:
POSTGRES_USER:amaniqueryPOSTGRES_DB:amaniquery
- Internal Connection URL: Copy this for use in service env vars.
Redis
- Type: Redis
- Name:
amaniquery-redis - Max Memory Policy:
allkeys-lru - Internal Connection URL: Copy this (
redis://...).
2. Backend Services (Docker Runtime)
Since AmaniQuery is a monorepo, using Docker as the Runtime is recommended for Go services to handle build context correctly (copying go.mod from root).
Common Configuration for All Backend Services
- Runtime: Docker
- Repository:
your-repo/amaniquery - Region: Same as Database.
| Service Name | Dockerfile Path | Build Context Directory | Env Vars |
|---|---|---|---|
amaniquery-portal |
services/portal/Dockerfile |
. (Root) |
SERVER_HTTP_PORT=8080, DB_HOST=... |
amaniquery-ingestion |
services/ingestion/Dockerfile |
. (Root) |
QDRANT_URL=..., RABBITMQ_URL=... |
amaniquery-voice |
services/voice/Dockerfile |
. (Root) |
OPENAI_API_KEY=... |
amaniquery-files |
services/files/Dockerfile |
. (Root) |
MINIO_ENDPOINT=... |
amaniquery-notifications |
services/notifications/Dockerfile.gateway |
. (Root) |
MAILTRAP_API_KEY=... |
Root Directory Setting: In Render, set "Root Directory" to
.(default) so Docker builds have access to the full monorepo context.
3. Frontend Applications (Static Sites)
We will use the Static Site type for frontends, relying on the Dockerfile or Render's Native Node build.
Recommendation: Use Static Site with Node build command for faster deploys, or Docker if you need Nginx customization.
Option A: Static Site (Native Node - Recommended)
- Build Command:
yarn && yarn turbo run build --filter=admin-portal - Publish Directory:
frontend/apps/admin/dist - Root Directory:
frontend
Option B: Docker (Using our new Turbo Dockerfiles)
- Runtime: Docker
- Dockerfile Path:
frontend/apps/admin/Dockerfile - Context:
frontend(Important: context isfrontendsubfolder, not root, for these specific Dockerfiles)
| App Name | Build Command (Static) | Publish Dir | Context |
|---|---|---|---|
admin-portal |
yarn build:admin |
apps/admin/dist |
frontend |
developer-portal |
yarn build:dev |
apps/developer-portal/dist |
frontend |
web-app |
yarn build:web |
apps/web/dist |
frontend |
Note: You may need to add helper scripts in
frontend/package.jsonlike"build:admin": "turbo run build --filter=admin-portal"to keep commands simple.
4. HuggingFace Spaces (Docker Deployment)
For users preferring HuggingFace Spaces (free tier: 2 vCPU, 16GB RAM, 50GB disk), follow these steps.
Prerequisites
- HuggingFace Account
- External Databases (Managed Services):
- PostgreSQL: Neon.tech (Free Tier available)
- Redis: Upstash (Free Tier available)
- Qdrant: Qdrant Cloud (Free Tier available)
Deployment Steps
Create a New Space:
- Go to HuggingFace Spaces
- Enter a name (e.g.,
amaniquery) - Select Docker as the Space SDK
- Choose "Blank" for the template
Deploy via Script (Recommended):
- Set
HF_TOKENin your local.env. - Run:
python scripts/deploy_hf.py agent - This deploys both the Go Agent and Rust Memory Service in a single container (Sidecar pattern) for maximum efficiency and localhost communication.
- Set
Deploy Manually (Alternative):
- Clone your Space's repository locally.
- Copy
deployments/huggingface/Dockerfile.hftoDockerfilein the root. - Copy
deployments/huggingface/README.mdto the root. - Push to HuggingFace.
Configure Secrets:
- Go to Settings -> Variables and Secrets in your Space.
- Add the secrets listed in
deployments/huggingface/.env.hf.example.
Status:
- The Space will build and start both
agent-serverandmemory-server. - The Go agent will automatically connect to the local memory service.
- The Space will build and start both
Automated Deployment (Optional): We provided a script
scripts/deploy_hf.pyto automate the deployment process.Prerequisites:
HF_TOKENmust be set in your.envfile (Get it from HF Settings).- The Spaces must be created first (e.g.,
AmaniQuery/amaniquery-agentandAmaniQuery/amaniquery-memory).
Usage:
# Deploy Agent python scripts/deploy_hf.py agent # Deploy Memory Service python scripts/deploy_hf.py memory # Deploy Both python scripts/deploy_hf.py all
5. Environment Variables Checklist
Transfer these from your env.example files to Render's "Environment" tab for each service.
- Portal:
DB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME,REDIS_URL,JWT_SECRET - Voice:
OPENAI_API_KEY,ELEVENLABS_API_KEY,REDIS_URL - Frontend:
VITE_API_BASE_URL(Set this to thehttps://...onrender.comURL of your Portal service).
6. Deployment Order
- Infrastructure (Postgres/Redis) - Wait for healthy.
- Backend Services (Portal, etc.) - Deploy & check logs.
- Frontend Apps - Deploy & update
VITE_API_BASE_URLwith backend URL.