Skip to content

ADDING COMPOSE #7208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions docker_comopse/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
services:
osrm-extract_partition_customize:
image: ghcr.io/project-osrm/osrm-backend:v6.0.0
volumes:
- /mnt/graid/projects/osrm:/data
- ./prepare_osrm.sh:/prepare_osrm.sh
command: /prepare_osrm.sh

restart: "no"
networks:
- osrm_osrm-network


osrm-routed:
hostname: osrm-routed
image: ghcr.io/project-osrm/osrm-backend:v6.0.0
ports:
- "5050:5000"
volumes:
- /mnt/graid/projects/osrm:/data
command: >
osrm-routed
--algorithm mld
--max-matching-size 100
--max-trip-size 100
--max-table-size 100
--max-nearest-size 100
--max-alternatives 3
--ip 0.0.0.0
--port 5000
/data/iran-latest.osrm
networks:
- nginx-network
- osrm_osrm-network
restart: always

depends_on:
osrm-frontend:
condition: service_healthy

osrm-frontend:
hostname: osrm-frontend
image: osrm/osrm-frontend
#ports:
# - "9966:9966"
restart: always
environment:
- OSRM_BACKEND_URL=https://osrmapi.buluttakin.com:443
networks:
- nginx-network
- osrm_osrm-network
volumes:
- /mnt/graid/projects/osrm:/data
healthcheck:
test: ["CMD", "test", "-f", "/data/osrm_map_generated"]
interval: 6s
timeout: 600s
retries: 60000


networks:
nginx-network:
external: true
osrm_osrm-network:
driver: bridge
12 changes: 12 additions & 0 deletions docker_comopse/prepare_osrm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

if [ -f /data/osrm_map_generated ]; then
echo "OSRM data already prepared, skipping."
else
echo "OSRM data not found, preparing..."
osrm-extract -p /opt/car.lua /data/iran-latest.osm.pbf &&
osrm-partition /data/iran-latest.osrm &&
osrm-customize /data/iran-latest.osrm &&
touch /data/osrm_map_generated
fi