1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00
chhoto-url/Dockerfile

28 lines
670 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 simply-shorten
WORKDIR /simply-shorten
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 /simply-shorten/target/x86_64-unknown-linux-musl/release/simply-shorten /simply-shorten
COPY ./actix/resources /resources
CMD ["/simply-shorten"]