- Notifications
You must be signed in to change notification settings - Fork3.8k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
ADDING COMPOSE#7208
Conversation
elshan2000 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Docker Compose Setup for Project OSRM
This directory contains aDocker Compose configuration to simplify running [Project OSRM](https://github.com/Project-OSRM/osrm-backend).
With this way:
- Only use docker compose up -d
- It launches afrontend service with health checks.
- Don't need to ensure services start in the correct order.
📂 Directory Structure
osrm-backend/├── docker-compose.yml├── prepare_osrm.shQuick Start
Clone this repository
git clone https://github.com/elshan2000/osrm-backend.gitcd osrm-backendHow It Works
Init Service
Checks for the marker file
osrm_is_created.If not present, runs:
osrm-extractosrm-partitionosrm-customize
Creates the marker file.
Exits after preparation.
Backend Service
- Depends on thefrontend healthcheck.
- Starts
osrm-routedserving prepared data.
Frontend Service
- Periodically checks for the presence of the marker file
osrm_is_created. - Reports
healthywhen the preparation is complete. - This readiness allows the backend service to start safely.
Health Check Logic
Thefrontend container performs a health check by verifying:
/data/osrm_is_createdOnce the file exists, the health check reportshealthy. This ensures that:
✅ Data preparation is complete before routing starts.
Clean Up
To stop and remove all containers:
docker compose down
To force re-preparation of the data (for example, if you want to regenerate.osrm files):
docker compose downrm ./data/osrm_is_createddocker compose up -d
Contribution
This Docker Compose configuration was contributed by [elshan2000](https://github.com/elshan2000).
Feel free to open issues or submit improvements!
License
This project follows the [Project OSRM](https://github.com/Project-OSRM/osrm-backend) license (BSD-2-Clause).
DennisOSRM left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wonder if README2 ist the right name for the file. The content seems good, tho.
elshan2000 commentedOct 22, 2025
i can move this readme to docker_compose directory |
Uh oh!
There was an error while loading.Please reload this page.
Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Please read ourdocumentation on release and version management.
If your PR is still work in progress please attach the relevant label.
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?