shrijayan commited on
Commit
e25f988
·
verified ·
1 Parent(s): 82a4b72

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -16
Dockerfile CHANGED
@@ -1,32 +1,26 @@
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 (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"]
 
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"]