-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
65 lines (44 loc) · 1.54 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
57
58
59
60
61
62
63
64
65
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 rust-toolchain.toml rust-toolchain.toml
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 bike bike
COPY petgraph petgraph
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 --profile prod --recipe-path recipe.json --features prod
COPY gtfs-structure gtfs-structure
COPY gtfs-structure-2 gtfs-structure-2
COPY bike bike
COPY petgraph petgraph
RUN cargo build -p gtfs-structure-2 --profile prod
# Build application
COPY src src
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
RUN cargo build --profile prod --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/prod/timetoreach /usr/bin/timetoreach
ENV RUST_LOG info,timetoreach=debug,h2=info,hyper=info,warp=info,rustls=info
ENTRYPOINT ["/usr/bin/timetoreach"]