Supercellat124578 commited on
Commit
ee0aea0
·
1 Parent(s): f00c4f2

fix: move OSRM data to /osrm-data to avoid HuggingFace volume mount overwrite

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -6
  2. start.sh +3 -5
  3. supervisord.conf +1 -1
Dockerfile CHANGED
@@ -16,13 +16,13 @@ RUN apk update && apk add --no-cache \
16
  RUN adduser -D -u 1000 user
17
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
18
 
19
- RUN mkdir -p /data && chmod 777 /data
20
  RUN wget -q "https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf" \
21
- -O /data/map.osm.pbf \
22
- && osrm-extract -p /opt/car.lua /data/map.osm.pbf \
23
- && osrm-partition /data/map.osrm \
24
- && osrm-customize /data/map.osrm \
25
- && rm /data/map.osm.pbf \
26
  && echo "OSRM preprocessing complete"
27
 
28
  WORKDIR $HOME/app
 
16
  RUN adduser -D -u 1000 user
17
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
18
 
19
+ RUN mkdir -p /osrm-data && chmod 777 /osrm-data
20
  RUN wget -q "https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf" \
21
+ -O /osrm-data/map.osm.pbf \
22
+ && osrm-extract -p /opt/car.lua /osrm-data/map.osm.pbf \
23
+ && osrm-partition /osrm-data/map.osrm \
24
+ && osrm-customize /osrm-data/map.osrm \
25
+ && rm /osrm-data/map.osm.pbf \
26
  && echo "OSRM preprocessing complete"
27
 
28
  WORKDIR $HOME/app
start.sh CHANGED
@@ -2,18 +2,16 @@
2
  set -e
3
 
4
  echo " RouteWave starting..."
5
- echo " OSRM data: /data/map.osrm"
6
  echo " Backend port: ${PORT:-7860}"
7
  echo " OSRM port: 5001"
8
 
9
- # Ensure OSRM data exists
10
- if [ ! -f "/data/map.osrm" ]; then
11
- echo "ERROR: OSRM data not found at /data/map.osrm"
12
  echo " The Dockerfile should have preprocessed this during build."
13
  exit 1
14
  fi
15
 
16
  echo "OSRM data found"
17
 
18
- # Start supervisord (manages OSRM + Express)
19
  exec supervisord -c /etc/supervisord.conf
 
2
  set -e
3
 
4
  echo " RouteWave starting..."
5
+ echo " OSRM data: /osrm-data/map.osrm"
6
  echo " Backend port: ${PORT:-7860}"
7
  echo " OSRM port: 5001"
8
 
9
+ if [ ! -f "/osrm-data/map.osrm" ]; then
10
+ echo "ERROR: OSRM data not found at /osrm-data/map.osrm"
 
11
  echo " The Dockerfile should have preprocessed this during build."
12
  exit 1
13
  fi
14
 
15
  echo "OSRM data found"
16
 
 
17
  exec supervisord -c /etc/supervisord.conf
supervisord.conf CHANGED
@@ -6,7 +6,7 @@ loglevel=info
6
  pidfile=/tmp/supervisord.pid
7
 
8
  [program:osrm]
9
- command=osrm-routed --algorithm mld --port 5001 --max-table-size 10000 /data/map.osrm
10
  autostart=true
11
  autorestart=true
12
  startretries=5
 
6
  pidfile=/tmp/supervisord.pid
7
 
8
  [program:osrm]
9
+ command=osrm-routed --algorithm mld --port 5001 --max-table-size 10000 /osrm-data/map.osrm
10
  autostart=true
11
  autorestart=true
12
  startretries=5