mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-12-23 04:07:55 +00:00
4a8385955b
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.
29 lines
646 B
Docker
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"]
|