# Ship Manifest - Example Fleet Configuration
# https://github.com/seuros/mothership

# Global configuration (command center)
[mothership]
metrics_port = 9090

# Named binds (external listeners)
[mothership.bind]
http = "0.0.0.0:80"
ws = "0.0.0.0:8080"

# Web ships (HTTP-serving applications)
[[fleet.web]]
name = "app"
command = "python3"
args = ["-m", "http.server", "3000"]
bind = "tcp://0.0.0.0:3000"
healthcheck = "/"
routes = [
  { bind = "http", pattern = "/.*" },
]

[[fleet.web]]
name = "anycable"
command = "python3"
args = ["-m", "http.server", "8081"]
bind = "tcp://0.0.0.0:8081"
healthcheck = "/"
routes = [
  { bind = "ws", pattern = "/cable" },
  { bind = "ws", pattern = "/ws/.*" },
]

# Background workers
[[fleet.workers]]
name = "sidekiq"
command = "sleep"
args = ["infinity"]
critical = false  # Non-critical: crash won't kill fleet

# One-shot jobs (run once and exit)
# [[fleet.jobs]]
# name = "migrate"
# command = "bundle"
# args = ["exec", "rails", "db:migrate"]
# oneshot = true

# WASM modules (optional plugins)
# [[modules]]
# name = "auth"
# wasm = "modules/auth.wasm"
# routes = ["/admin/.*"]
# phase = "request"
