-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (20 loc) · 795 Bytes
/
Dockerfile
File metadata and controls
23 lines (20 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Leveraging the pre-built Docker images with
# cargo-chef and the Rust toolchain
FROM lukemathwalker/cargo-chef:latest-rust-1.59.0-slim-buster AS chef
WORKDIR app
FROM chef AS planner
COPY app/ .
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
# Build application
COPY app/ .
RUN cargo build --release --bin exobuilds-website
FROM debian:buster-slim as runner
RUN apt-get -qy update && apt-get -qy upgrade
COPY --from=builder /app/target/release/exobuilds-website /usr/local/bin/exobuilds-website
COPY --from=builder /app/public /public
COPY --from=builder /app/templates /templates
CMD exobuilds-website