Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.81 KB

File metadata and controls

91 lines (63 loc) · 2.81 KB

Render deployment guide

Deploy the full stack (API, worker, frontend, PostgreSQL, Redis) on Render.

One-click deploy (Blueprint)

  1. Push this repo to GitHub.
  2. In Render: New → Blueprint.
  3. Connect the repository and apply render.yaml.
  4. Wait for all services to finish building (first deploy takes ~5–10 minutes).

Services created

Service Type URL / role
jobqueue-api Web (Docker) https://jobqueue-api.onrender.com
jobqueue-worker Background worker Consumes Redis queue
jobqueue-frontend Static site https://jobqueue-frontend.onrender.com
jobqueue-db PostgreSQL Internal only
jobqueue-redis Redis Internal only

Default login

After the API is running, sign in to the frontend with:

  • Email: admin@jobqueue.com
  • Password: admin123

Environment variables

Set automatically by the blueprint:

Variable Service Purpose
VITE_API_URL Frontend API base URL (baked in at build time)
FRONTEND_URL API CORS + WebSocket allowed origin
JWT_SECRET API Auto-generated signing key
DB_* API, Worker PostgreSQL connection
REDIS_URL API, Worker Redis connection
PORT API Set by Render (do not override)

WebSocket URL is derived automatically: {VITE_API_URL}/ws/jobs.

Manual deploy (without Blueprint)

API (Web Service)

  • Runtime: Docker
  • Dockerfile: jobqueue-api/Dockerfile
  • Docker context: repository root
  • Health check: /actuator/health

Worker (Background Worker)

  • Runtime: Docker
  • Dockerfile: jobqueue-worker/Dockerfile
  • Docker context: repository root

Frontend (Static Site)

  • Root directory: jobqueue-frontend
  • Build command: npm install && npm run build
  • Publish directory: dist
  • Environment: VITE_API_URL=https://<your-api-host>.onrender.com

Add a rewrite rule /* → /index.html for client-side routing.

Free tier notes

  • Services spin down after ~15 minutes of inactivity (cold start ~30–60s).
  • Free PostgreSQL expires after 90 days; upgrade or export data before then.
  • Redeploy the frontend after the API URL changes so VITE_API_URL is correct.

Troubleshooting

Issue Fix
CORS errors Confirm FRONTEND_URL on the API matches the frontend https:// URL exactly
Jobs stuck in QUEUED Check worker logs; verify REDIS_URL is set on worker
502 on API Check API logs; ensure Postgres and Redis are linked
WebSocket fails API must be deployed; frontend uses {API_URL}/ws/jobs

Local development

Unchanged — use Docker Compose:

docker-compose up -d

Frontend dev server proxies to localhost:8080 via Vite (no VITE_API_URL needed locally).