Skip to content

akvo/akvo-maps

Repository files navigation

akvo-maps

Akvo Maps provide a Docker image of Windshaft based server.

Usage

Run

The latest docker image can be found at https://hub.docker.com/r/akvo/akvo-maps/

The image expects to find the configuration file at /config/environment.js. The provided configuration file will be merged with the default configuration

The default configuration does not provides defaults for everything. You will need to provide some values. See an configuraton file example

Some of the configuration is just passed to Windshaft. See the renderer section on this example for some documentation.

Redis

Windshaft uses Redis to store the queries, so a Redis DB must be made available and the configuration must point to it.

API

See Windshaft API docs

Additionally, to create the layergroup, you need to provide the following headers:

  1. X-DB-HOST: Postgres DB host.
  2. X-DB-USER: Postgres DB user.
  3. X-DB-PASSWORD: Postgres DB password.
  4. X-DB-NAME: Postgres DB name.
  5. X-DB-PORT: Postgres DB port.
  6. X-DB-LAST-UPDATE. See caching docs

Javascript client example

See an example that uses Leaflet.

Development

Run:

docker-compose up 

This will create an environment with:

  • two instances of windshaft, that will be restarted whenever there is a change in the "windshaft" folder
  • postgres, with a running PostgreSQL + PostGis and a preloaded "test_database" database
  • redis
  • tests, with a Clojure REPL for end to end testing.

See the docker-compose.yml file for the enabled ports.

Once docker has started, you can use the viewer to play around with it.

Running tests

Connect to the Clojure REPL and run them from there or run:

docker-compose run tests lein test