Welcome to OHDM Docker’s documentation!¶
OHDM is a date sensitive map server like open street map.
Install Requirements¶
The only requirement for this project is Docker & Docker-Compose.
Docker¶
To install Docker on Mac & Windows download Docker Desktop https://www.docker.com/products/docker-desktop
For Linux users read the doc for your linux distro on https://docs.docker.com/install/
Docker-Compose¶
In the docs for Docker-Compose are install instruction for Linux, Mac & Windows. Just follow the instruction to get done. https://docs.docker.com/compose/install/
Setup¶
Docker¶
Network¶
Every Docker container witch should be accessible from internet need for this project in the web network. To create the network just run:
$ docker network create web
Build containers¶
To manually build every image (need to be in project directory to work):
$ docker-compose build
Tipp: when you build every container, get you a coffee or a cold beer, it will take some time :)
Settings (.env)¶
To use settings copy the .env-example to .env.:
$ cp .env-example .env
Hostname or Domain of the server:
# Hostname
HOSTNAME=localhost
Email address for Let’s Encrypt SSL certificate:
# SSL
ACME_EMAIL=info@localhost.com
Postgis Database & User:
# Database
POSTGRES_USER=ohdm
POSTGRES_PASSWORD=ohdm
Tile Server& Mapnik style cache time in seconds:
# cache expire time in seconds ( 604800 seconds == 7 days )
CAHCE_EXPIRE_TIME=604800
Tile Server debug mode:
# DEBUG=True
DEBUG=False
Tile Server tile & mapnik style cache:
CACHE=True
# CACHE=False
Start the server¶
After install the requirements & build the docker images you can start the server with (need to be in project directory to work):
$ docker-compose up webserver
In Terminal you can see what is going on on every docker container and if everything work fine, you can the website
on your host domain like https://<hostname>/
To stop the server use control
+ c
Start the server in background use:
$ docker-compose up -d webserver
Adminer Database Interface¶
To use the adminer
container to edit the database, start at first adminer
in background:
$ docker-compose up -d adminer-db
Than you can go to https://db-admin.<hostname>/
to enter the adminer
database interface.
For the login data use
System | PostgresSQL |
Server | postgis |
Username | POSTGRES_USER from .env |
Password | POSTGRES_PASSWORD from .env |
Database | gis |
Tile Server¶
The Tile Server is based on:
Software / Framework | Function |
Mapnik | tile gernator |
Python bindings for Mapnik | Python bindings for Mapnik |
Redis | cache for tiles & Mapnik styles |
PostGis | OHDM Database |
Flask | Python microservice webserver |
openstreetmap-carto | OSM styles for Mapnik |
NGINX | Webserver to use flask in production |
URL Mapping¶
The Tile Server listen on https://<hostname>/tile/<year>/<month>/<day>/<zoom>/<x_pixel>/<y_pixel>.png
Example for display the World on the 01.01.2019
on the host example.com
is
https://example.com/tile/2019/01/01/0/0/0.png
Source Code¶
The source code of the Flask microservice is on tile_server/code/app.py
Website Integration¶
The website demo is in the project on website
and is build with leaflet and
Boostrap 4
To see how to implement OHDM in leaflet just take a look on website/index.html
.
This is just a basic example with everything you need to start :)
Documentation¶
Comming soon