You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,34 +5,65 @@ This repository contains a minimal Docker Compose setup for running
5
5
[MapLibre](https://maplibre.org/) and [Chart.js](https://www.chartjs.org/).
6
6
7
7
## Prerequisites
8
+
8
9
- Docker Desktop with Docker Compose v2+
9
10
- (Optional) GDAL >= 3.0 for converting data to other formats
10
11
11
12
## Usage
13
+
12
14
1. Build and start the services:
13
15
```bash
14
16
docker compose up --build
15
17
```
16
18
2. Access pygeoapi at [http://localhost:5000](http://localhost:5000)
17
19
3. Access the frontend at [http://localhost:8080](http://localhost:8080)
18
20
21
+
## Deployment
22
+
23
+
### Environment Variables
24
+
25
+
When deploying pygeoapi in different environments (local, Kubernetes, etc.), the following environment variables should be set:
26
+
27
+
-`PYGEOAPI_SERVER_URL`: The external URL where pygeoapi will be accessible. This is used to generate correct links in the API responses.
28
+
- For local development: `http://localhost:5000`
29
+
- For Kubernetes/production: Your domain, e.g., `https://your-domain.com`
30
+
31
+
### Kubernetes Deployment
32
+
33
+
To deploy to Kubernetes:
34
+
35
+
1. Edit the `k8s-pygeoapi.yaml` file to set the correct `PYGEOAPI_SERVER_URL` for your environment
36
+
2. Apply the Kubernetes configuration:
37
+
```bash
38
+
kubectl apply -f k8s-pygeoapi.yaml
39
+
```
40
+
41
+
The Kubernetes deployment includes:
42
+
43
+
- A Deployment for pygeoapi
44
+
- A Service to expose pygeoapi within the cluster
45
+
- An Ingress resource (optional) to expose pygeoapi externally
46
+
19
47
The backend Docker image now generates the OpenAPI document at build
20
48
time and exposes it via the `PYGEOAPI_OPENAPI` environment variable.
21
49
22
50
The frontend fetches features from pygeoapi and displays them on a
23
51
MapLibre map and Chart.js chart.
24
52
25
53
## Data
54
+
26
55
The sample dataset resides in `data/norway/norway-hazard-points.geojson`. You can replace
27
56
this file with your own dataset. Update `pygeoapi-config.yml`
28
57
if you change the path or dataset name.
29
58
30
59
## Development
60
+
31
61
This repository uses **Black**, **isort**, and **Ruff** for Python code. The frontend is formatted with **Prettier**. Recommended VS Code settings are provided in the `.vscode` folder.
32
62
Run `pip install -r requirements-dev.txt` to install Python tooling. Frontend formatting tools can be installed by running `npm install` inside the `frontend` directory.
33
63
Use `npm run format` to format frontend code.
34
64
35
65
## CI/CD
66
+
36
67
A GitHub Actions workflow builds and publishes the frontend Docker image whenever
37
68
changes are pushed to the `frontend/` directory on the `main` branch. The image
38
69
is pushed to the GitHub Container Registry under the tag
0 commit comments