From cab002333feb737709d4a3e4dfb1d291591fd884 Mon Sep 17 00:00:00 2001 From: Ewen Date: Wed, 15 Feb 2023 22:25:21 +0100 Subject: [PATCH] =?UTF-8?q?ajout=C3=A9=20docker=20+=20modif=20update=5Fdb?= =?UTF-8?q?=5Fosm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/.env | 3 +++ docker/Dockerfile | 3 +++ docker/docker-compose.yml | 12 ++++++++++++ scripts_v2/update_db_osm.sh | 10 +++++----- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 docker/.env create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml diff --git a/docker/.env b/docker/.env new file mode 100644 index 0000000..22cb964 --- /dev/null +++ b/docker/.env @@ -0,0 +1,3 @@ +POSTGRES_USER=redadeg +POSTGRES_PASSWORD=redadeg +POSTGRES_DB=redadeg diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5846898 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,3 @@ +FROM postgis/postgis:12-2.5 + +RUN apt update && apt install -y postgresql-12-pgrouting diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..4156f27 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3.9" + +services: + db: + build: . + env_file: .env + volumes: + - ./dbdata:/var/lib/postgresql/data + +volumes: + dbdata: + diff --git a/scripts_v2/update_db_osm.sh b/scripts_v2/update_db_osm.sh index f1286f1..3558de0 100755 --- a/scripts_v2/update_db_osm.sh +++ b/scripts_v2/update_db_osm.sh @@ -9,10 +9,10 @@ date echo "" # on efface les dumps existants -rm -f /data/dumps/*.pbf +rm -f ~/dev/ar_redadeg/dataosm/dumps/*.pbf # on récupère le dernier dump France -wget -O /data/dumps/france-latest.osm.pbf http://download.geofabrik.de/europe/france-latest.osm.pbf +wget -O ~/dev/ar_redadeg/dataosm/dumps/france-latest.osm.pbf http://download.geofabrik.de/europe/france-latest.osm.pbf echo "" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @@ -24,7 +24,7 @@ echo "" # on le decoupe selon un polygone # utiliser JOSM avec le plugin poly pour créer un fichier .poly -osmconvert /data/dumps/france-latest.osm.pbf -B=/data/dumps/poly_extraction_bzh.poly --complete-ways -v -o=/data/dumps/breizh.osm.pbf +osmconvert ~/dev/ar_redadeg/dataosm/dumps/france-latest.osm.pbf -B=~/dev/ar_redadeg/dataosm/dumps/poly_extraction_bzh.poly --complete-ways -v -o=~/dev/ar_redadeg/dataosm/dumps/breizh.osm.pbf echo "" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @@ -36,11 +36,11 @@ echo "" # on met à jour la base de données # authentification dans le pgpass -osm2pgsql -H db.openstreetmap.local -U osmbr -d osm --hstore --slim --cache 3000 -E 3857 -v /data/dumps/breizh.osm.pbf +osm2pgsql -H db.openstreetmap.local -U osmbr -d osm --hstore --slim --cache 3000 -E 3857 -v ~/dev/ar_redadeg/dataosm/dumps/breizh.osm.pbf echo "" echo " Fin de la maj de la BD " echo "" date -echo "" \ No newline at end of file +echo ""