Deploy with Docker Compose

The quickest way to get InfraWatch running. No repo clone needed — just two files and one command.

Prerequisites

Step 1 — Create a .env file

Create a new directory for InfraWatch and add a .env file with your configuration:

.env
# Admin account email
ADMIN_EMAIL=admin@company.com

# AWS Power Keys (server-side only, never exposed to users)
POWER_AWS_ACCESS_KEY_ID=AKIA...
POWER_AWS_SECRET_ACCESS_KEY=...
POWER_AWS_REGION=us-east-1
BASE_ROLE_ARN=arn:aws:iam::123456789012:role/PowerUserRole

# Collector regions (optional — empty = all regions)
# COLLECTOR_REGIONS=us-east-1,us-east-2,us-west-2

# SMTP (for OTP and notification emails)
SMTP_HOST=smtp.company.com
SMTP_PORT=587
SMTP_USER=...
SMTP_PASSWORD=...
SMTP_FROM=noreply@company.com

# Postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=awsdashboard
POSTGRES_USER=awsdashboard
POSTGRES_PASSWORD=<strong-password>

# Valkey
VALKEY_PASSWORD=<strong-password>
VALKEY_URL=redis://:${VALKEY_PASSWORD}@valkey:6379

# App
COOKIE_SECURE=false
CORS_ORIGINS=http://localhost:4000
OTP_EXPIRY_MINUTES=10
OTP_MAX_ATTEMPTS=5

# Auto-registration whitelist (optional)
# ALLOWED_DOMAINS=company.com,contractor.com
Important
Replace all placeholder values (AKIA..., <strong-password>, etc.) with your actual credentials. Never commit the .env file to version control.

See the Configuration Reference for details on every variable.

Step 2 — Create docker-compose.yml

docker-compose.yml
services:
  backend:
    image: mguptahub/infrawatch-backend:latest
    env_file:
      - .env
    depends_on:
      - db
      - valkey

  frontend:
    image: mguptahub/infrawatch-frontend:latest
    ports:
      - "4000:8080"
    depends_on:
      - backend

  db:
    image: postgres:16
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-awsdashboard}
      POSTGRES_USER: ${POSTGRES_USER:-awsdashboard}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?required}
    volumes:
      - db_data:/var/lib/postgresql/data

  valkey:
    image: valkey/valkey:8-alpine
    command: ["valkey-server", "--requirepass", "${VALKEY_PASSWORD:?required}"]

volumes:
  db_data:

Step 3 — Start services

Terminal
docker compose up -d

Verify

Open http://localhost:4000 in your browser. Log in with the email set in ADMIN_EMAIL — you'll receive a 6-digit OTP code via email.

Check that all containers are running:

Terminal
docker compose ps

You should see backend, frontend, db, and valkey all in a healthy state.

For HTTPS (production)
Set COOKIE_SECURE=true and CORS_ORIGINS=https://your-domain.com in your .env. Place a reverse proxy (nginx, Caddy, Traefik) in front of the frontend container.