aboutsummaryrefslogtreecommitdiff
path: root/build_renfe/Dockerfile
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2026-03-26 09:53:39 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2026-03-26 09:53:52 +0100
commit84db1ca075dc63ccb02da825948d95ad09f94e4d (patch)
treeb9678bec669304bb3201a1e40a86bb3828150fac /build_renfe/Dockerfile
parent291450f2add8ddd6ed8757b2bdbfceb476be3033 (diff)
Convert submodules to regular repo files, add custom feeds
Diffstat (limited to 'build_renfe/Dockerfile')
-rw-r--r--build_renfe/Dockerfile25
1 files changed, 25 insertions, 0 deletions
diff --git a/build_renfe/Dockerfile b/build_renfe/Dockerfile
new file mode 100644
index 0000000..f565320
--- /dev/null
+++ b/build_renfe/Dockerfile
@@ -0,0 +1,25 @@
+# Use a multi-stage build to download necessary files
+FROM alpine/curl AS downloader
+
+RUN curl -L https://download.geofabrik.de/europe/spain/galicia-latest.osm.pbf -o /galicia-latest.osm.pbf
+RUN curl -L https://raw.githubusercontent.com/railnova/osrm-train-profile/refs/heads/master/basic.lua -o /opt/train.lua
+
+FROM osrm/osrm-backend
+
+# Copy the downloaded OSM file from the downloader stage
+COPY --from=downloader /galicia-latest.osm.pbf /data/galicia-latest.osm.pbf
+COPY --from=downloader /opt/train.lua /opt/train.lua
+
+# Extract the map data using osrm-train-profile (by Railnova)
+RUN osrm-extract -p /opt/train.lua /data/galicia-latest.osm.pbf
+
+# Prepare the map data for routing
+RUN osrm-partition /data/galicia-latest.osrm
+RUN osrm-customize /data/galicia-latest.osrm
+
+# Expose the OSRM server port
+EXPOSE 5000
+
+# Start the OSRM server
+CMD ["osrm-routed", "--algorithm", "mld", "/data/galicia-latest.osrm"]
+