# Meezi — Caddy reverse proxy
#
# Set DOMAIN and ACME_EMAIL in your .env, then:
#   docker compose -f docker-compose.yml -f docker-compose.admin.yml -f docker-compose.caddy.yml up -d
#
# Caddy auto-provisions Let's Encrypt TLS — no certbot needed.
# Domains needed in DNS (all → same server IP):
#   meezi.ir, app.meezi.ir, api.meezi.ir,
#   koja.meezi.ir, admin.meezi.ir, admin-api.meezi.ir

{
    email {$ACME_EMAIL}
}

# ── Marketing website ────────────────────────────────────────────────────────
{$DOMAIN} {
    reverse_proxy website:3000
}

# ── Cafe owner dashboard ─────────────────────────────────────────────────────
app.{$DOMAIN} {
    reverse_proxy web:3000
}

# ── Main API ─────────────────────────────────────────────────────────────────
api.{$DOMAIN} {
    reverse_proxy api:8080
}

# ── Koja (public discovery) ──────────────────────────────────────────────────
koja.{$DOMAIN} {
    reverse_proxy koja:3000
}

# ── Super-Admin panel ────────────────────────────────────────────────────────
admin.{$DOMAIN} {
    reverse_proxy admin-web:3000
}

# ── Super-Admin API ──────────────────────────────────────────────────────────
admin-api.{$DOMAIN} {
    reverse_proxy admin-api:8080
}
