Best practices for deploying Qulaxy in production environments
Before deploying to production, ensure you have:
Deploy using Amazon ECS or EC2:
Deploy using Google Cloud Run or GKE:
Deploy using Azure Container Instances or AKS:
Simple and cost-effective deployment:
version: '3.8'
services:
backend:
image: ghcr.io/qulaxyqa/qulaxy-backend:latest
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 3000
API_PREFIX: api/v1
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET}
AGENT_SECRET: ${AGENT_SECRET}
ACTIVITY_SERVICE_HOST: activity-log-service
ACTIVITY_SERVICE_PORT: 3001
INITIAL_ADMIN_EMAIL: ${INITIAL_ADMIN_EMAIL}
INITIAL_ADMIN_PASSWORD: ${INITIAL_ADMIN_PASSWORD}
ports:
- "3000:3000"
depends_on:
- postgres
- redis
- activity-log-service
volumes:
- qulaxy-uploads:/app/uploads
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "3000"]
interval: 30s
timeout: 10s
retries: 3
frontend:
image: ghcr.io/qulaxyqa/qulaxy-frontend:latest
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- backend
activity-log-service:
image: ghcr.io/qulaxyqa/qulaxy-activity-log:latest
restart: unless-stopped
environment:
PORT: 3001
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
ports:
- "3001:3001"
agent-node:
image: ghcr.io/qulaxyqa/qulaxy-agent-node:latest
restart: unless-stopped
environment:
API_BASE_URL: http://backend:3000/api/v1
REDIS_HOST: redis
REDIS_PORT: 6379
AGENT_SECRET: ${AGENT_SECRET}
depends_on:
- backend
agent-python:
image: ghcr.io/qulaxyqa/qulaxy-agent-python:latest
restart: unless-stopped
environment:
API_BASE_URL: http://backend:3000/api/v1
REDIS_HOST: redis
REDIS_PORT: 6379
AGENT_SECRET: ${AGENT_SECRET}
depends_on:
- backend
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.2-alpine
restart: unless-stopped
volumes:
- redis-data:/data
command: redis-server --appendonly yes
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- frontend
volumes:
postgres-data:
redis-data:
qulaxy-uploads:
/api/v1. You can run it behind any server IP or domain as long as Nginx proxies
/api/ and /socket.io/ to the backend.
Set up free SSL certificates:
certbot --nginx -d qulaxy.yourcompany.com
Automated PostgreSQL backup script:
pg_dump -U qulaxy_user qulaxy > backup_$(date +%Y%m%d).sql