From fad138600af3a226fb450df2d3284113b2533121 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 22 Jun 2023 12:11:43 +0200 Subject: [PATCH] Add disk for database and tiles, instructions for import --- .gitignore | 6 ++++++ README.md | 22 +++++++++++++++++++++- database/.gitkeep | 0 docker-compose.yml | 14 +++++++++----- pbf/.gitkeep | 0 tiles/.gitkeep | 0 6 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 database/.gitkeep create mode 100644 pbf/.gitkeep create mode 100644 tiles/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4fdc04 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +pbf/*.pbf +pbf/*.poly +tiles/* +!tiles/.gitkeep +database/* +!database/.gitkeep \ No newline at end of file diff --git a/README.md b/README.md index a37c6bb..9244af3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is an adaptation of https://github.com/Overv/openstreetmap-tile-server/ for #### Fresh install ```bash -docker volume create osm-data +#docker volume create osm-data docker-compose build ``` @@ -22,7 +22,27 @@ docker-compose run --rm map terminal #### Do an import +Download a pbf and a poly file of your choice on https://download.geofabrik.de and put it in the `pbf` folder. Change the lines of the pbf and poly paths in the volumes in the `docker-compose.yml` file +Then, you can import the OSM data by doing this command: + +```bash +docker-compose run --rm map import +``` + +This will take a while, about 15 min for Luxembourg for example. + +You should end with : + +``` +... +INFO:root: Importing into database +INFO:root: Import complete ++ sudo -u renderer touch /data/database/planet-import-complete ++ service postgresql stop + * Stopping PostgreSQL 15 database server [ OK ] ++ exit 0 +``` ## Original README diff --git a/database/.gitkeep b/database/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 318b127..a2f2d47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,12 +4,16 @@ services: map: image: overv/openstreetmap-tile-server volumes: - - osm-data:/data/database/ - - ./run.sh:/run.sh + #- osm-data:/data/database/ + - ./database:/data/database/ + - ./tiles:/data/tiles/ + - ./run.sh:/run.sh # for dev + - ./pbf/luxembourg-latest.osm.pbf:/data/region.osm.pbf # change here your pbf + - ./pbf/luxembourg.poly:/data/region.poly # and your poly ports: - "8080:80" command: "run" -volumes: - osm-data: - external: true +# volumes: +# osm-data: +# external: true diff --git a/pbf/.gitkeep b/pbf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tiles/.gitkeep b/tiles/.gitkeep new file mode 100644 index 0000000..e69de29