Update Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
@@ -7,22 +7,26 @@ WORKDIR /data
|
|
7 |
# Install wget (required to download OSM data)
|
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
|
16 |
-
# 3. Customize
|
17 |
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf && \
|
18 |
-
osrm-partition berlin-latest.
|
19 |
-
osrm-customize berlin-latest.
|
20 |
|
21 |
-
#
|
22 |
RUN chown -R osrm:osrm /data
|
23 |
|
24 |
-
# Expose port 7860
|
25 |
EXPOSE 7860
|
26 |
|
27 |
-
# Start
|
28 |
-
CMD ["osrm-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.
|
|
|
7 |
# Install wget (required to download OSM data)
|
8 |
RUN apt-get update && apt-get install -y wget
|
9 |
|
10 |
+
# Create 'osrm' group and user to fix permission issues
|
11 |
+
RUN groupadd -r osrm && \
|
12 |
+
useradd -r -g osrm -d /data -s /sbin/nologin osrm
|
13 |
+
|
14 |
# Download an example OSM extract (Berlin)
|
15 |
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
16 |
|
17 |
# Preprocess the OSM data:
|
18 |
# 1. Extract data using the car profile
|
19 |
+
# 2. Partition the graph for MLD algorithm
|
20 |
+
# 3. Customize partitioned data
|
21 |
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf && \
|
22 |
+
osrm-partition berlin-latest.osm && \
|
23 |
+
osrm-customize berlin-latest.osm
|
24 |
|
25 |
+
# Ensure files are owned by 'osrm' for proper service execution
|
26 |
RUN chown -R osrm:osrm /data
|
27 |
|
28 |
+
# Expose port 7860 for Hugging Face Spaces
|
29 |
EXPOSE 7860
|
30 |
|
31 |
+
# Start OSRM routing engine on port 7860 using MLD algorithm
|
32 |
+
CMD ["osrm-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.osm"]
|