starchart/Dockerfile

29 lines
843 B
Text
Raw Normal View History

2022-05-24 20:43:18 +05:30
FROM rust:latest as planner
RUN cargo install cargo-chef
2022-05-23 18:53:13 +05:30
WORKDIR /src
COPY . /src/
2022-05-24 20:43:18 +05:30
RUN cargo chef prepare --recipe-path recipe.json
FROM rust:latest as cacher
WORKDIR /src/
RUN cargo install cargo-chef
COPY --from=planner /src/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
FROM rust:latest as builder
WORKDIR /src/
COPY . .
COPY --from=cacher /src/target target
2022-05-23 18:53:13 +05:30
RUN make release
FROM debian:bullseye-slim
2022-05-23 18:53:13 +05:30
LABEL org.opencontainers.image.source https://github.com/forgeflux-org/starchart
RUN apt-get update && apt-get install -y ca-certificates
2022-05-24 20:43:18 +05:30
COPY --from=builder /src/target/release/starchart /usr/local/bin/
COPY --from=builder /src/config/default.toml /etc/starchart/config.toml
COPY scripts/entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/entrypoint.sh
CMD [ "/usr/local/bin/entrypoint.sh" ]