app = "rateright-au"
primary_region = "syd"

[build]
  dockerfile = "Dockerfile.production"

[env]
  PORT = "8080"
  FLASK_APP = "run.py"
  FLY_APP_NAME = "rateright-au"

[deploy]
  # release_command = "flask db upgrade"  # Temporarily disabled - migrations already applied

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = false  # CRITICAL: Prevent auto-suspension
  auto_start_machines = true
  min_machines_running = 1    # Keep at least 1 machine always running

[[services]]
  protocol = "tcp"
  internal_port = 8080

  [[services.ports]]
    port = 80
    handlers = ["http"]

  [[services.ports]]
    port = 443
    handlers = ["tls", "http"]

[[http_service.checks]]
  grace_period = "30s"
  interval = "30s"
  method = "GET"
  path = "/"
  timeout = "10s"
