OGC API — Processes deployment using pygeoapi. Configure offerings in pygeoapi-config.yml (see publishing processes in the pygeoapi workshop).
Prerequisites: Docker (on Windows, Docker Desktop must be running).
From the repository root:
docker compose up --build- The API is served at http://localhost:5000 (host port
5000maps to container port80). docker-compose.ymlcontains shared settings.docker-compose.override.ymlis loaded automatically for local development and enables live code mounts plus hot reload.docker-compose.prod.ymlcontains production overrides.
-
processes/,app.yml, and./tmpare bind-mounted into the container. -
PYTHONPATH=/pygeoapimakes Python load the liveprocesses/tree (over the copy installed in the image). -
Session directories from
lare-startappear under./tmpon the host whensdi.tmp.tmpdirinapp.ymlis/pygeoapi/tmp(mapped to./tmp).
pyproject.toml lists the allowed dependencies; uv.lock records the resolved versions. Docker installs from the lock file into the base image's existing /venv without removing its other packages. No local Python or uv installation is needed.
After editing pyproject.toml, update uv.lock using the already-built project image (on a fresh checkout, run docker compose build first):
# PowerShell, from the repository root
docker compose run --rm --no-deps -v "${PWD}:/workspace" -w /workspace --entrypoint uv pygeoapi lock --python /venv/bin/python# Linux/macOS shell, from the repository root
docker compose run --rm --no-deps -v "$PWD:/workspace" -w /workspace --entrypoint uv pygeoapi lock --python /venv/bin/pythonReview and commit both pyproject.toml and uv.lock, then rebuild with docker compose build --no-cache. The build uses uv sync --locked and fails if the manifest and lock file disagree, rather than choosing new dependency versions.
Set environment variable LARE_TMPDIR in the container to override sdi.tmp.tmpdir from app.yml. Use a container path that is mounted for session artifacts.
For Docker Compose, copy .env.example to .env and set LARE_TMPDIR_HOST to the absolute host path that GeoServer can read. Examples:
# Windows development
LARE_TMPDIR_HOST=C:/develop/lare/tmp
# Alma/Linux production
LARE_TMPDIR_HOST=/opt/lare/tmpFrom /opt/lare:
mkdir -p tmp
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --build -dThe base Compose file defines the shared mounts. The production override adds restart: unless-stopped, sets ${LARE_TMPDIR_HOST:-/opt/lare/tmp} as the GeoServer-visible temp directory, and adds host.docker.internal for Linux Docker hosts.
Useful endpoints:
| URL | Purpose |
|---|---|
| http://localhost:5000/ | Landing page |
| http://localhost:5000/processes | Process list |
| http://localhost:5000/openapi | OpenAPI document / Swagger UI |
Stop:
docker compose downIf port 5000 is already in use, change the left side of the port mapping in docker-compose.yml (e.g. 5001:80).
- Start with the debug override (exposes 5678 for the IDE):
docker compose -f docker-compose.yml -f docker-compose.debug.yml up --build-
In Cursor/VS Code, start Attach pygeoapi (Docker) (
.vscode/launch.json). -
Set breakpoints under
processes/and call the API as usual. For async jobs, addPrefer: respond-asyncto the request.
No changes inside process code are required; sync and async (TinyDB job threads) use the same attach.
Async responses are 202 with a Location (or Link) to the job; poll that URL until the job finishes, then open the results link from the job document.
Instead of manually executing each endpoint in Swagger UI, run the saved API test cases against the running Compose service from a container.
- Copy the example cases file to
tests/api_cases.local.json(kept out of git) and edit it with your payloads. Use{{sessionid}}in later steps; it is filled fromlare-start. - With
docker compose up -drunning, execute the runner from the repository root:
# PowerShell
docker compose run --rm --no-deps -v "${PWD}\tests:/pygeoapi/lare-tests:ro" --entrypoint /venv/bin/python pygeoapi /pygeoapi/lare-tests/run_api_tests.py --cases /pygeoapi/lare-tests/api_cases.local.json --base-url http://pygeoapi:80# Linux/macOS shell
docker compose run --rm --no-deps -v "$PWD/tests:/pygeoapi/lare-tests:ro" --entrypoint /venv/bin/python pygeoapi /pygeoapi/lare-tests/run_api_tests.py --cases /pygeoapi/lare-tests/api_cases.local.json --base-url http://pygeoapi:80Optional flags:
--timeout 180
The runner exits with code 1 if any case fails (useful for CI later).
To add a new process such as process_new.py:
-
Create a new input model in
processes/models.py. Add a Pydantic model that defines and validates the request payload for the new process. -
Implement the workflow in
processes/handlers/{new}.py. Put the actual process logic in a handler function such asmain_handler. Keep file I/O, geospatial work, and publishing logic here. -
Create the pygeoapi processor in
processes/process_{new}.py. Add aPROCESS_METADATAdictionary and a processor class such asLareNewProcessor. -
Define clear process metadata. Include the process
id,title,description,jobControlOptions,inputs,outputs, and anexample. This metadata controls how the process appears in pygeoapi. -
Register the process in
pygeoapi-config.yml. Add a new entry underresources:that points to the processor class, for exampleprocesses.process_new.LareNewProcessor. -
Reuse shared configuration from
processes/config.py. Useget_config()for paths, GeoServer settings, layers, and the temp directory instead of hardcoding values. -
After starting Docker, check that the new process appears at
/processesand that it executes correctly through the API.
GPL-3.0 (see pygeoapi-config.yml metadata).