2022-12-28 01:20:44 +00:00
|
|
|
# Build image
|
|
|
|
FROM rust:1.65 as builder
|
|
|
|
|
|
|
|
# Run dummy build to build and cache dependencies that only depends on Cargo.toml and Cargo.lock
|
|
|
|
WORKDIR /usr/src
|
|
|
|
RUN USER=root cargo new blessed-rs
|
|
|
|
COPY Cargo.toml Cargo.lock /usr/src/blessed-rs/
|
|
|
|
WORKDIR /usr/src/blessed-rs
|
|
|
|
RUN cargo build --release
|
2022-05-01 21:18:30 +00:00
|
|
|
|
2022-12-28 01:20:44 +00:00
|
|
|
# Run actual build
|
|
|
|
COPY ./src ./src
|
|
|
|
COPY ./data ./data
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
# Run image
|
|
|
|
FROM debian:buster-slim
|
|
|
|
# RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /usr/src/blessed-rs/target/release/blessed-rs /usr/local/bin/blessed-rs
|
2022-03-14 00:16:20 +00:00
|
|
|
|
|
|
|
WORKDIR /usr/blessed-rs
|
|
|
|
COPY ./static ./static
|
|
|
|
COPY ./templates ./templates
|
|
|
|
COPY ./data ./data
|
2022-03-14 01:03:36 +00:00
|
|
|
CMD ["blessed-rs"]
|