Update Dockerfile
Browse files- Dockerfile +10 -16
Dockerfile
CHANGED
@@ -1,32 +1,26 @@
|
|
1 |
-
# Use
|
2 |
FROM ghcr.io/project-osrm/osrm-backend:latest
|
3 |
|
4 |
-
# Set working directory
|
5 |
WORKDIR /data
|
6 |
|
7 |
-
# Install wget
|
8 |
RUN apt-get update && apt-get install -y wget
|
9 |
|
10 |
-
#
|
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 |
-
#
|
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 |
-
#
|
26 |
-
|
|
|
27 |
|
28 |
-
# Expose port
|
29 |
EXPOSE 7860
|
30 |
|
31 |
-
# Start
|
32 |
CMD ["osrm-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.osm"]
|
|
|
1 |
+
# Use official OSRM backend image
|
2 |
FROM ghcr.io/project-osrm/osrm-backend:latest
|
3 |
|
4 |
+
# Set working directory
|
5 |
WORKDIR /data
|
6 |
|
7 |
+
# Install wget
|
8 |
RUN apt-get update && apt-get install -y wget
|
9 |
|
10 |
+
# Download Berlin data
|
|
|
|
|
|
|
|
|
11 |
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
12 |
|
13 |
+
# Process data AS ROOT (default)
|
|
|
|
|
|
|
14 |
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf && \
|
15 |
osrm-partition berlin-latest.osm && \
|
16 |
osrm-customize berlin-latest.osm
|
17 |
|
18 |
+
# Make ALL FILES WORLD-READABLE ⚠️ Security tradeoff!
|
19 |
+
# Required for Hugging Face's arbitrary UID execution
|
20 |
+
RUN chmod -R o+rwX /data
|
21 |
|
22 |
+
# Expose required port
|
23 |
EXPOSE 7860
|
24 |
|
25 |
+
# Start service normally
|
26 |
CMD ["osrm-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.osm"]
|