For the complete documentation index, see llms.txt. This page is also available as Markdown.

Method 2: Deployment Using Docker Compose

On-prem Deployment Guide (AWS)

Goal: Deploy Hivel VM services using Docker Compose with manual orchestration.

Prerequisites:

  • Database Migration completed successfully

  • .env file configured with application user credentials (DB_USER and DB_PASSWORD)

  • Docker and Docker Compose installed on VM

  • AWS ECR access configured (IAM role or AWS CLI credentials)

  • Advanced Docker and Docker Compose knowledge

Step 1: Authenticate with AWS ECR

Application/System: EC2 VM (AWS CLI and Docker)

Goal: Log Docker in to the AWS ECR registry so images can be pulled.

For Hivel's ECR:

# Authenticate with ECR
aws ecr get-login-password --region ap-south-1 | \
  docker login --username AWS --password-stdin \
  730335373269.dkr.ecr.ap-south-1.amazonaws.com

For your own ECR:

Expected result: Output shows Login Succeeded.

If it fails: Verify AWS credentials are configured and have ECR permissions.

Step 2: Create Docker Network

Application/System: EC2 VM (Docker)

Goal: Create a shared network for all services to communicate.

Expected result: Command prints a network ID with no errors.

Step 3: Deploy VM Services

Application/System: EC2 VM (Docker Compose)

Goal: Pull images and start all services.

On your EC2 VM, run:

Wait 2-5 minutes for all services to start.

Docker Compose Management Commands

Use these commands to manage services after deployment:

Important Notes

  • All commands must be run from /opt/hivel-onprem/services/vm directory

  • Always use --env-file ../../config/.env to ensure services read correct configuration

  • Services communicate via the microservices_network created in Step 2

  • Logs are displayed live with docker-compose logs -f; use Ctrl+C to exit

  • Do not manually manage the Docker network or service ordering; Docker Compose handles this

  • Keep all services on the same Docker network for communication


Next Steps

After successful deployment:

  1. Verify all services are running: docker-compose ps

  2. Check logs for any errors: docker-compose logs

  3. Access the Hivel application at the configured frontend URL


Quick Troubleshooting

  • Image pull fails: Verify ECR authentication succeeded (Login Succeeded)

  • Services fail to start: Check .env file has correct database credentials and RDS is reachable

  • Services can't communicate: Verify all services are on microservices_network with docker network inspect microservices_network

  • Permission denied errors: Ensure user running Docker Compose has Docker permissions

See Troubleshooting for detailed solutions.

Last updated