kopia lustrzana https://github.com/kartoza/docker-osm
fix docker-compose and update descriptions
rodzic
d4b7f88d1f
commit
55e884f9ad
|
@ -5,10 +5,8 @@ volumes:
|
||||||
import_done:
|
import_done:
|
||||||
import_queue:
|
import_queue:
|
||||||
cache:
|
cache:
|
||||||
pg:
|
|
||||||
grafana:
|
|
||||||
pw2:
|
|
||||||
osm_settings:
|
osm_settings:
|
||||||
|
pgadmin_data:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
|
@ -40,7 +38,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
# Read the README in docker-osm-pbf
|
# Read the README in docker-osm-pbf
|
||||||
- CONTINENT=africa
|
- CONTINENT=africa
|
||||||
- COUNTRY=lesotho
|
- COUNTRY=south-africa
|
||||||
- BASE_URL=http://download.geofabrik.de
|
- BASE_URL=http://download.geofabrik.de
|
||||||
- MAPPING_URL=https://raw.githubusercontent.com/kartoza/docker-osm/develop/settings
|
- MAPPING_URL=https://raw.githubusercontent.com/kartoza/docker-osm/develop/settings
|
||||||
- GEOJSON_URL=''
|
- GEOJSON_URL=''
|
||||||
|
@ -125,30 +123,18 @@ services:
|
||||||
# if 0, then no update will be done, only the first initial import from the PBF
|
# if 0, then no update will be done, only the first initial import from the PBF
|
||||||
- TIME=120
|
- TIME=120
|
||||||
command: bash -c "while [ ! -f /home/settings/country.pbf ] ; do sleep 1; done && python3 -u /home/download.py"
|
command: bash -c "while [ ! -f /home/settings/country.pbf ] ; do sleep 1; done && python3 -u /home/download.py"
|
||||||
pgwatch2:
|
|
||||||
image: cybertec/pgwatch2-postgres
|
pgadmin4:
|
||||||
hostname: pgwatch2
|
image: dpage/pgadmin4:4.16
|
||||||
|
hostname: pgadmin4
|
||||||
volumes:
|
volumes:
|
||||||
- pg:/var/lib/postgresql
|
- pgadmin_data:/var/lib/pgadmin
|
||||||
- grafana:/var/lib/grafana
|
|
||||||
- pw2:/pgwatch2/persistent-config
|
|
||||||
environment:
|
environment:
|
||||||
- PW2_TESTDB=false
|
- PGADMIN_DEFAULT_EMAIL=docker@gmail.com
|
||||||
- PW2_PG_SCHEMA_TYPE=metric-dbname-time
|
- PGADMIN_DEFAULT_PASSWORD=docker
|
||||||
- PW2_WEBNOANONYMOUS=true
|
|
||||||
- PW2_WEBUSER=admin
|
|
||||||
- PW2_WEBPASSWORD=pgwatch2
|
|
||||||
- PW2_WEBNOCOMPONENTLOGS=false
|
|
||||||
- PW2_WEBHOST=0.0.0.0
|
|
||||||
- PW2_WEBPORT=8080
|
|
||||||
- PW2_GRAFANANOANONYMOUS=true
|
|
||||||
- PW2_GRAFANAUSER=admin
|
|
||||||
- PW2_GRAFANAPASSWORD=pgwatch2
|
|
||||||
- PW2_GRAFANA_BASEURL=http://0.0.0.0:3000
|
|
||||||
restart: on-failure
|
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 6500:80
|
||||||
- 8082:8080
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
18
readme.md
18
readme.md
|
@ -12,8 +12,9 @@ a smaller extent than the one specified by the PBF) and run the docker compose p
|
||||||
## Quick setup
|
## Quick setup
|
||||||
|
|
||||||
As a quick example, we are going to setup Docker-OSM with default values everywhere:
|
As a quick example, we are going to setup Docker-OSM with default values everywhere:
|
||||||
* Download a PBF file from http://download.geofabrik.de/
|
* Run the docker-compose file and make sure the environment variables are setup properly for
|
||||||
* Put the file in the `settings` folder.
|
osm_downloader to download the correct pbf file.
|
||||||
|
|
||||||
* If you want to connect from your local QGIS Desktop:
|
* If you want to connect from your local QGIS Desktop:
|
||||||
* In the file `docker-compose.yml`, uncomment the block:
|
* In the file `docker-compose.yml`, uncomment the block:
|
||||||
|
|
||||||
|
@ -22,8 +23,9 @@ As a quick example, we are going to setup Docker-OSM with default values everywh
|
||||||
ports:
|
ports:
|
||||||
- "35432:5432"
|
- "35432:5432"
|
||||||
```
|
```
|
||||||
* Do `make run` in the build directory. This will download and execute the docker-osm project. It might be very long depending of your bandwidth and the PBF you are importing.
|
* Do `make run` in the build directory. This will download and execute the docker-osm project.
|
||||||
* In QGIS, add a new PostGIS connexion: `localhost`, database `gis`, port `35432`, `docker` for both username and password.
|
It might be very long depending of your bandwidth and the PBF you are importing.
|
||||||
|
* In QGIS, add a new PostGIS connection: `localhost`, database `gis`, port `35432`, `docker` for both username and password.
|
||||||
* That's it! You have an OSM database, up and running. The update is done every 2 minutes from the main OSM website.
|
* That's it! You have an OSM database, up and running. The update is done every 2 minutes from the main OSM website.
|
||||||
|
|
||||||
For further reading and customizations, read below.
|
For further reading and customizations, read below.
|
||||||
|
@ -47,15 +49,11 @@ your existing docker-compose project.
|
||||||
In this example we will set up an OSM database for South Africa that
|
In this example we will set up an OSM database for South Africa that
|
||||||
will pull for updates every 2 minutes.
|
will pull for updates every 2 minutes.
|
||||||
|
|
||||||
First get a PBF file from your area and put this file in the 'settings' folder.
|
Specify a PBF file for your area in the environment variables for `osm_downloader` container.
|
||||||
You can download some PBF files on these URLS for instance :
|
You can download some PBF files on these URLS for instance :
|
||||||
* http://download.geofabrik.de/
|
* http://download.geofabrik.de/
|
||||||
* http://download.openstreetmap.fr/extracts/
|
* http://download.openstreetmap.fr/extracts/
|
||||||
|
|
||||||
```bash
|
|
||||||
cd settings
|
|
||||||
wget -c -O country.pbf http://download.openstreetmap.fr/extracts/africa/south_africa.osm.pbf
|
|
||||||
```
|
|
||||||
|
|
||||||
You must put only one PBF file in the settings folder. Only the last one will be read.
|
You must put only one PBF file in the settings folder. Only the last one will be read.
|
||||||
|
|
||||||
|
@ -122,7 +120,7 @@ Now build the docker images needed to run the application:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose build
|
docker-compose build
|
||||||
docker-compose up
|
docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
In production you should daemonize the services when bringing them up:
|
In production you should daemonize the services when bringing them up:
|
||||||
|
|
Ładowanie…
Reference in New Issue