Skip to main content

Docker Deployment

Igris ships with a Dockerfile for containerized deployment. This guide covers building the image, running locally, and deploying to Fly.io.

Building the Image

From the repository root:
docker build -t igris-api -f Dockerfile .
The Dockerfile uses a multi-stage build:
  1. Install — installs dependencies with Bun
  2. Build — compiles the Hono API server
  3. Runtime — minimal production image

Running Locally

docker run -p 3100:3100 \
  -e DATABASE_URL="postgresql://user:pass@host/igris" \
  -e BETTER_AUTH_SECRET="your-secret-here" \
  -e BETTER_AUTH_URL="http://localhost:3100" \
  -e UPSTASH_REDIS_REST_URL="https://your-redis.upstash.io" \
  -e UPSTASH_REDIS_REST_TOKEN="your-token" \
  igris-api
The API server starts on port 3100. Database migrations run automatically on startup.

Deploying to Fly.io

1. Install the Fly CLI

curl -L https://fly.io/install.sh | sh
fly auth login

2. Create the App

fly apps create igris-api

3. Set Secrets

fly secrets set \
  DATABASE_URL="postgresql://..." \
  BETTER_AUTH_SECRET="..." \
  BETTER_AUTH_URL="https://igris-api.fly.dev" \
  UPSTASH_REDIS_REST_URL="https://..." \
  UPSTASH_REDIS_REST_TOKEN="..." \
  GITHUB_CLIENT_ID="..." \
  GITHUB_CLIENT_SECRET="..." \
  GOOGLE_CLIENT_ID="..." \
  GOOGLE_CLIENT_SECRET="..." \
  DODO_API_KEY="..."

4. Deploy

fly deploy

5. Verify

fly status
curl https://igris-api.fly.dev/health

Fly.io Configuration

The fly.toml should include:
[build]

[http_service]
  internal_port = 3100
  force_https = true
  auto_stop_machines = false
  auto_start_machines = true

[checks]
  [checks.health]
    type = "http"
    port = 3100
    path = "/health"
    interval = "30s"
    timeout = "5s"
Set auto_stop_machines = false to keep the proxy always available for MCP tool calls.

Frontend Deployment

The Next.js frontend can be deployed separately:
  • Fly.io — similar process with a separate Dockerfile
  • Vercel — connect the repo, set the root directory to apps/web
Set the NEXT_PUBLIC_API_URL environment variable to point to your API deployment.

Health Check

The API exposes a /health endpoint that returns:
{
  "status": "ok",
  "database": "connected",
  "redis": "connected",
  "version": "1.0.0"
}
Use this for load balancer health checks and uptime monitoring.