Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official OSRM backend image as base
|
2 |
+
FROM ghcr.io/project-osrm/osrm-backend:latest
|
3 |
+
|
4 |
+
# Set working directory to /data
|
5 |
+
WORKDIR /data
|
6 |
+
|
7 |
+
# Install wget (if not already installed)
|
8 |
+
RUN apt-get update && apt-get install -y wget
|
9 |
+
|
10 |
+
# Download an example OSM extract (Berlin)
|
11 |
+
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
12 |
+
|
13 |
+
# Preprocess the OSM data:
|
14 |
+
# 1. Extract data using the car profile
|
15 |
+
# 2. Partition the graph for the MLD algorithm
|
16 |
+
# 3. Customize the partitioned data
|
17 |
+
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf && \
|
18 |
+
osrm-partition berlin-latest.osrm && \
|
19 |
+
osrm-customize berlin-latest.osrm
|
20 |
+
|
21 |
+
# Expose port 7860 (Hugging Face Spaces expects the app to listen on this port)
|
22 |
+
EXPOSE 7860
|
23 |
+
|
24 |
+
# Start the OSRM routing engine on port 7860 using the MLD pipeline
|
25 |
+
CMD ["osrm-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.osrm"]
|