-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
26 lines (23 loc) · 1018 Bytes
/
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
FROM lukemathwalker/cargo-chef:latest-rust-1.57.0 AS chef
WORKDIR /app
FROM chef AS planner
COPY . /www/app/
WORKDIR /www/app/
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /www/app/recipe.json /www/app/recipe.json
WORKDIR /www/app/
# Build dependencies - this is the caching Docker layer!
RUN RUST_BACKTRACE=full cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . /www/app/
RUN cargo build --release --bin lnfilestoreserver
# We do not need the Rust toolchain to run the binary!
FROM debian:buster-slim AS runtime
RUN apt update && apt install -y libpq-dev curl bash
WORKDIR /www/app/
COPY --from=builder /www/app/target/release/lnfilestoreserver /www/app/target/release/lnfilestoreserver
COPY --from=builder /www/app/migrations /www/app/migrations
# COPY --from=builder /www/app/rocket.docker.toml /www/app/rocket.toml
# COPY --from=builder /www/app/diesel.toml /www/app/diesel.toml
ENTRYPOINT ["/www/app/target/release/lnfilestoreserver"]