Compose & Health Checks

How Lift detects your build method (Compose, Dockerfile, Nixpacks) and performs two-phase health checks with auto-rollback.

Build Detection

Lift automatically detects the best build method based on files in your project root, in order of priority:

PriorityMethodDetected FilesWhat Happens
1Docker Composecompose.yml, compose.yaml, docker-compose.yml, docker-compose.yamlRuns docker compose up --build -d. Generates Traefik override if domain is configured.
2DockerfileDockerfileRuns docker build with BuildKit cache for fast rebuilds.
3NixpacksNone (fallback)Zero-config builds. Auto-detects Node.js, Python, Ruby, Go, and more.

Health Checks & Auto-Rollback

Production deployments include a two-phase health check:

  1. Container check -- Verifies all replicas are in the "running" state
  2. HTTP check -- Sends requests to the app port (5 retries, 3-second intervals)

If the health check fails, Lift automatically rolls back to the previous image:

Deploy flow with health check failure:

lift push
✓ Code uploaded
✓ Rollback history updated  # prev1 = current working image
✓ Build complete
✓ 1 container(s) started
✗ HTTP health check failed after 5 attempts
  Attempt 1: Connection refused
  Attempt 2: Connection refused
  Attempt 3: HTTP 500
  Attempt 4: HTTP 500
  Attempt 5: HTTP 500
⚠ Health check failed. Initiating auto-rollback...
✓ Rolled back to previous version
Error: Deployment failed health check. Rolled back to previous version.

Traefik Health Routing

When a domain is configured, Traefik automatically routes traffic only to healthy containers. Health check labels are injected into the compose configuration:

  • loadbalancer.healthcheck.path -- Configurable health endpoint (from tool proxy settings)
  • loadbalancer.healthcheck.interval -- Check interval (5s)

This ensures that during zero-downtime deploys, traffic is never routed to a container that hasn't finished starting.

Autoheal

A server-level autoheal container monitors Docker healthchecks and restarts containers that become unhealthy. It is installed once per server (not per tool) and covers all containers automatically. See Zero-Downtime Deploys for details.