|
1 | | -FROM python:3.10.9-slim-bullseye as build |
2 | | - |
3 | | -### Installation des dépendances |
4 | | -RUN apt update && apt install -y wget git g++ cmake libboost-dev libboost-filesystem-dev libboost-thread-dev \ |
5 | | - libboost-system-dev libboost-regex-dev libxml2-dev libsparsehash-dev libbz2-dev \ |
6 | | - zlib1g-dev libzip-dev libgomp1 liblua5.3-dev \ |
7 | | - pkg-config libgdal-dev libboost-program-options-dev libboost-iostreams-dev \ |
8 | | - libboost-test-dev libtbb-dev libexpat1-dev |
9 | | - |
10 | | -### Installation d'OSRM |
11 | | -WORKDIR /home/osrm/ |
12 | | -RUN wget https://github.com/Project-OSRM/osrm-backend/archive/v5.26.0.tar.gz && tar -xzf v5.26.0.tar.gz && cd osrm-backend-5.26.0 && \ |
13 | | - mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . && cmake --build . --target package |
14 | | - |
15 | | -### Installation de Valhalla |
16 | | -### Dépendances |
17 | | -RUN apt-get update && \ |
18 | | -apt-get install -y cmake make libtool pkg-config g++ gcc curl unzip jq lcov protobuf-compiler \ |
19 | | -vim-common locales libcurl4-openssl-dev zlib1g-dev liblz4-dev libprotobuf-dev && \ |
20 | | -apt-get install -y libgeos-dev libgeos++-dev libluajit-5.1-dev libspatialite-dev libsqlite3-dev wget sqlite3 spatialite-bin python3-shapely && \ |
21 | | -apt-get install -y libsqlite3-mod-spatialite |
22 | | - |
23 | | -WORKDIR /home/prime-server |
24 | | -RUN apt-get install -y git cmake autoconf automake pkg-config libtool make gcc g++ lcov libcurl4-openssl-dev libzmq3-dev libczmq-dev |
25 | | -RUN git clone --depth 1 --recursive https://github.com/kevinkreiser/prime_server.git && cd prime_server && \ |
26 | | -cmake -B build . && cmake --build build && make -C build install |
27 | | - |
28 | | -WORKDIR /home/valhalla/ |
29 | | -RUN pip install --upgrade "conan<2.0.0" |
30 | | -RUN git clone --branch 3.2.0-with_hard_exclude --depth 1 --recursive https://github.com/IGNF/valhalla.git && cd valhalla && \ |
31 | | -mkdir build && cmake -B build -DCMAKE_BUILD_TYPE=Release && make -C build && make -C build package |
32 | | - |
33 | | -FROM python:3.10.9-slim-bullseye as r2gg |
34 | | - |
35 | | -ENV PYTHON_VERSION "3.10.9" |
| 1 | +# OSRM binaries |
| 2 | +FROM ghcr.io/project-osrm/osrm-backend:v6.0.0 AS osrm |
| 3 | + |
| 4 | +# Valhalla binaries |
| 5 | +FROM ghcr.io/valhalla/valhalla:3.6.1 AS valhalla |
| 6 | + |
| 7 | +# Prime server build |
| 8 | +FROM debian:bookworm AS prime_build |
| 9 | +RUN apt-get update && apt-get install -y \ |
| 10 | + git cmake make gcc g++ pkg-config \ |
| 11 | + libcurl4-openssl-dev libzmq3-dev libczmq-dev |
| 12 | + |
| 13 | +RUN git clone --depth 1 --recursive https://github.com/kevinkreiser/prime_server.git |
| 14 | +WORKDIR /prime_server |
| 15 | +RUN cmake -B build . && cmake --build build && make -C build install |
| 16 | + |
| 17 | +# Final runtime image |
| 18 | +FROM python:3.10.19-slim-trixie AS r2gg |
| 19 | + |
| 20 | +ENV PYTHON_VERSION="3.10.9" |
36 | 21 | ENV HOME=/home |
37 | 22 |
|
38 | | -### Installation des dépendances pour OSRM |
39 | | -RUN apt update && apt install -y libboost-dev libboost-filesystem-dev libboost-thread-dev \ |
40 | | - libboost-system-dev libboost-regex-dev libxml2-dev libsparsehash-dev \ |
41 | | - libgomp1 liblua5.3-dev \ |
42 | | - pkg-config libgdal-dev libboost-program-options-dev libboost-iostreams-dev \ |
43 | | - libboost-test-dev libtbb-dev libexpat1-dev |
44 | | - |
45 | | -### Installation des dépendances pour Valhalla |
46 | | -RUN apt-get update && \ |
47 | | - apt-get install -y libtool pkg-config curl unzip jq lcov protobuf-compiler \ |
48 | | - vim-common locales libcurl4-openssl-dev zlib1g-dev liblz4-dev libprotobuf-dev && \ |
49 | | - apt-get install -y libgeos-dev libgeos++-dev libluajit-5.1-dev libspatialite-dev libsqlite3-dev wget sqlite3 spatialite-bin python3-shapely && \ |
50 | | - apt-get install -y libsqlite3-mod-spatialite |
51 | | -RUN apt-get install -y git libcurl4-openssl-dev libzmq3-dev libczmq-dev |
52 | | - |
53 | | -### Installation d'OSRM |
54 | | -COPY --from=build /home/osrm/osrm-backend-5.26.0/build/OSRM-0.1.1-Linux.tar.gz ./ |
55 | | -RUN tar -xzvf OSRM-0.1.1-Linux.tar.gz && cd OSRM-0.1.1-Linux && cp -r bin/* /usr/bin/ && cp -r lib/* /usr/lib/ && cp -r include/* /usr/include/ && cp -r share/* /usr/share/ |
| 23 | +# Runtime dependencies only |
| 24 | +RUN apt-get update && apt-get install -y \ |
| 25 | + libboost-filesystem-dev libboost-system-dev \ |
| 26 | + libcurl4 libprotobuf-dev libgeos-dev \ |
| 27 | + libluajit-5.1-2 libsqlite3-mod-spatialite \ |
| 28 | + && rm -rf /var/lib/apt/lists/* |
| 29 | + |
| 30 | +COPY --from=osrm /usr/local/bin/osrm-* /usr/local/bin/ |
| 31 | +COPY --from=osrm /usr/local/lib /usr/local/lib |
56 | 32 |
|
57 | 33 | ### Installation prime-server |
58 | | -COPY --from=build /usr/local/lib/libprime_server.so.0.7.2 /usr/lib/libprime_server.so.0.0.0 |
59 | | -COPY --from=build /usr/local/lib/libprime_server.so.0 /usr/lib/libprime_server.so.0 |
60 | | -COPY --from=build /usr/local/lib/libprime_server.so /usr/lib/libprime_server.so |
| 34 | +COPY --from=prime_build /usr/local/lib/libprime_server.so* /usr/lib/ |
61 | 35 |
|
62 | 36 | ### Installation de valhalla |
63 | | -COPY --from=build /home/valhalla/valhalla/build/valhalla-3.2.0-Linux.tar.gz ./ |
64 | | -RUN tar -xzvf valhalla-3.2.0-Linux.tar.gz && cd valhalla-3.2.0-Linux && cp -r bin/* /usr/bin/ && cp -r lib/* /usr/lib/ && cp -r include/* /usr/include/ && cp -r share/* /usr/share/ |
| 37 | +COPY --from=valhalla /usr/local/bin/valhalla_* /usr/local/bin/ |
| 38 | +COPY --from=valhalla /usr/local/lib/libvalhalla* /usr/local/lib/ |
65 | 39 |
|
66 | 40 | ### Installation des dépendances pour psycopg2 |
67 | 41 | RUN apt update && \ |
|
0 commit comments