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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -15
Dockerfile CHANGED
@@ -1,26 +1,26 @@
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"]
 
1
+ FROM ghcr.io/project-osrm/osrim-backend:latest
 
2
 
 
3
  WORKDIR /data
4
 
5
+ # Install dependencies
6
  RUN apt-get update && apt-get install -y wget
7
 
8
+ # Get Berlin data
9
  RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
10
 
11
+ # Process data WITH FULL PERMISSIONS:
12
+ # 1️⃣ Force liberal UMASK during creation (files=666/dirs=777)
13
+ # 2️⃣ Explicitly verify key file accessibility
14
+ RUN umask 000 && \
15
+ osrim-extract -p /opt/car.lua berlin-latest.osm.pbf && \
16
+ osrim-partition berlin-latest.osrim && \
17
+ osrim-customize berlin-latest.osrim && \
18
+ chmod -R a+rwX /data/*
19
 
20
+ # Final global permission sweep ⚠️ Security tradeoff accepted
21
+ RUN find /data -type d -exec chmod 777 {} \+ && \
22
+ find /data -type f -exec chmod 666 {} \+
23
 
 
24
  EXPOSE 7860
25
 
26
+ CMD ["osrim-routed", "--algorithm", "mld", "--port", "7860", "berlin-latest.osrim"]