mirror-chhoto-url/Dockerfile
SinTan1729 4a8385955b
chg: Renamed the project
When starting out, I kept the name same as the original project.
But I think I've made significant changes, so keeping the name
same would be disingenuous.
2024-02-10 18:29:50 -06:00

29 lines
646 B
Docker

FROM rust:slim AS build
ENV TARGET x86_64-unknown-linux-musl
RUN apt-get update && apt-get install -y musl-tools
RUN rustup target add "$TARGET"
RUN cargo install cargo-build-deps
RUN cargo new --bin chhoto-url
WORKDIR /chhoto-url
RUN rustup target add x86_64-unknown-linux-musl
COPY ./actix/Cargo.toml .
COPY ./actix/Cargo.lock .
RUN cargo build-deps --release --target=x86_64-unknown-linux-musl
COPY ./actix/src ./src
RUN cargo build --release --locked --target "$TARGET"
FROM scratch
COPY --from=build /chhoto-url/target/x86_64-unknown-linux-musl/release/chhoto-url /chhoto-url
COPY ./actix/resources /resources
CMD ["/chhoto-url"]