forked from econaxis/time2reach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (39 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM debian:12 AS base
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
COPY deploy/init.sh deploy/
RUN sh deploy/init.sh
RUN apt-get install -y libgdal-dev curl ca-certificates sqlite3 --no-install-recommends
FROM base as chef
RUN apt-get install -y build-essential pkg-config cmake libclang-dev libssl-dev --no-install-recommends
COPY deploy/deploy.sh deploy/
RUN sh deploy/deploy.sh
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo install cargo-chef
FROM chef as planner
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY gtfs-structure gtfs-structure
COPY gtfs-structure-2 gtfs-structure-2
COPY src src
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json --features prod
RUN cargo build -p gtfs-structure-2 --release
# Build application
COPY src src
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY gtfs-structure gtfs-structure
COPY gtfs-structure-2 gtfs-structure-2
RUN cargo build --release --features prod
FROM base AS run
WORKDIR /app
#COPY certificates /app/certificates
#COPY city-gtfs /app/city-gtfs
#COPY web/public /app/web/public
COPY --from=builder /app/target/release/timetoreach /usr/bin/timetoreach
ENV RUST_LOG info,timetoreach=debug,h2=info,hyper=info,warp=info,rustls=info
ENTRYPOINT ["/usr/bin/timetoreach"]