Since this project is aiming to be contained within Docker, there isn't much you will need other than Docker, docker-compose, and a system that can run Ubuntu based Dockerfiles.
If you are running Ubuntu, and don't have Docker installed, there is a bash script in the "scripts" directory called "install_docker.sh". Running this with 'sudo' will install both Docker and docker-compose.
This should be quite simple to start with docker-compose, although it may take a while depending on your system at network connection. (Depending on how you have Docker set up, you may need to 'sudo' some of these commands.)
- Clone the repository
git clone https://github.com/jimmyrocks/osm-tiles-mapnik
- Navigate into the repo directory
cd osm-tiles-mapnik
- Build the docker-compose using the command (This may take a while)
docker-compose build
- Bring up the docker-compose
docker-compose up -d
- Run the scripts to load the data into the database and start the tile server
bash ./scripts/initialize-server.sh
- Navigate your browser to:
http://localhost:3000
By default this project uses the US state of Rhode Island, since it is the smallest PBF available within the US. You may want to view different data.
- Find a .pbf file available for download, possibly from Geofabrik.
- Edit the "tileserver.env" file, change the "SAMPLE_DATASET_URL" variable to the URL for your selected PBF file.
- Edit the file at "tileserver/site/index.html", and find the Javascript variables "center" and "zoom". Replace these values with values that are relevant to your PDF file.
This project includes a docker-compose.yml file that pulls together three Dockerfiles:
- A base PostGIS:10 image (from mdillon)
- A "tools" Dockerfile (based on Ubuntu 16.04) which takes care of the data transformation tasks at set up
- A "tileserver" Dockerfile (based on Ubuntu 16.04) which runs Apache and mod_tile.
The guide that was used to create this process can be found on the switch2osm.org website. Many of the steps that are outlined in that guide have been coding into the Dockerfiles (especially in the tileserver Dockerfile). The tools Dockerfile follows closely to the Dockerfile contained in the OpenStreetMap Carto Project. The differences are mostly changes that were made in order to support PostGIS as well.