|
| 1 | +# Getting Started |
| 2 | + |
| 3 | +This guide walks you through running Forti locally using Docker Compose. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- [Docker](https://docs.docker.com/get-docker/) with Compose support |
| 8 | +- [just](https://just.systems/) (optional, but convenient) |
| 9 | + |
| 10 | +## 1. Prepare forecast data |
| 11 | + |
| 12 | +Forti reads forecast data from a local directory in [its own binary format](https://github.com/metno/forti-internalformat). You need to populate `data/forecast/` (relative to this repository root) before starting the stack — this is where Docker Compose expects data by default. |
| 13 | + |
| 14 | +### Using forti-prep (recommended) |
| 15 | + |
| 16 | +[forti-prep](https://github.com/metno/forti-prep) is a tool that converts NetCDF forecast files into the format Forti expects. Requires [uv](https://docs.astral.sh/uv/). |
| 17 | + |
| 18 | +```bash |
| 19 | +git clone https://github.com/metno/forti-prep |
| 20 | +cd forti-prep |
| 21 | +uv sync |
| 22 | +uv run forti-prep \ |
| 23 | + --config sample_config.json \ |
| 24 | + --output-dir /path/to/forti/data/forecast \ |
| 25 | + --version $(date +%s) \ |
| 26 | + your-forecast.nc |
| 27 | +``` |
| 28 | + |
| 29 | +See the [forti-prep README](https://github.com/metno/forti-prep) for details on writing a config file for your specific NetCDF input. |
| 30 | + |
| 31 | +### Writing your own loader |
| 32 | + |
| 33 | +If you have a different data source, you can produce the data directly in Forti's internal format. See [forti-internalformat](https://github.com/metno/forti-internalformat) for a full description of the format and Go code you can use to write it. |
| 34 | + |
| 35 | +## 2. Start the stack |
| 36 | + |
| 37 | +From the repository root, using just: |
| 38 | + |
| 39 | +```bash |
| 40 | +just run-docker |
| 41 | +``` |
| 42 | + |
| 43 | +Or directly with Docker Compose: |
| 44 | + |
| 45 | +```bash |
| 46 | +cd deploy |
| 47 | +docker compose up --build |
| 48 | +``` |
| 49 | + |
| 50 | +This starts `rawdataforecaster` and `jsonfrontend`. The first run will build the Docker images, which may take a few minutes. |
| 51 | + |
| 52 | +## 3. Verify |
| 53 | + |
| 54 | +```bash |
| 55 | +curl 'http://localhost:8080/?lat=59&lon=11' |
| 56 | +``` |
| 57 | + |
| 58 | +You should get a JSON forecast response. |
| 59 | + |
| 60 | +## Next steps |
| 61 | + |
| 62 | +See [`deploy/README.md`](deploy/README.md) for configuration options, including how to enable `correctedforecaster` and how to override data paths. |
0 commit comments