# Local orchestration (one-click)

This folder runs the Android Cast web stack locally without external DNS/server:

- Landing hub FE (nginx)
- Gitea FE (nginx) + Gitea app
- Crashes/tickets FE (nginx) + PHP-FPM + MariaDB

All services run in Docker and share the same repo checkout via bind mounts where possible.

## Quick start

```bash
cd orchestration
./deploy.sh
```

To fully stop and clean all orchestration resources on demand:

```bash
./cleanup.sh
```

That single command does both:

1. First run: creates config/runtime directories and starts containers
2. Next runs: rebuilds/updates and restarts changed services

## Local URLs

- Landing (hub + routed subapps): `http://localhost:8080/app/androidcast_project/`
- Gitea direct FE: `http://localhost:8081/`
- Crashes direct FE (optional debug): `http://localhost:8082/app/androidcast_project/crashes/`

Under landing, subpaths are proxied:

- `.../git/` -> HTTP redirect to `http://localhost:8081/` (dedicated gitea FE)
- `.../crashes/` -> crashes-fe

## Shared code base

- Hub and crash backend code are mounted from the current repo checkout into containers.
- Editing local files is reflected immediately (no image rebuild for static/PHP code paths).
- Gitea data uses persistent Docker volumes (`gitea-data`, `gitea-db` style via named volumes where applicable).

## Configuration

Copy `.env.example` to `.env` and tune if needed:

```bash
cp .env.example .env
```

Defaults are safe for local laptop use and avoid host DNS changes by using localhost + ports.

## Optional hosts aliases

No host edits are required. If you prefer hostnames, use:

```bash
./scripts/apply-hosts.sh
```

This adds/removes localhost aliases in `/etc/hosts`.
