Basic redirection working

This commit is contained in:
SinTan1729
2023-04-02 22:26:23 -05:00
parent 0e97516759
commit b9d76b6734
7 changed files with 139 additions and 27 deletions

View File

@@ -1,21 +1,27 @@
FROM rust:1 as build
RUN cargo install cargo-build-deps
RUN mkdir /actix
WORKDIR /actix
RUN cargo new --bin simply-shorten
WORKDIR /simply-shorten
COPY ./actix/cargo.toml /actix/cargo.toml
COPY ./actix/cargo.lock /actix/cargo.lock
COPY ./actix/Cargo.toml .
COPY ./actix/Cargo.lock .
RUN cargo build --deps-only
RUN cargo build-deps --release
COPY ./actix /actix
COPY ./actix/src ./src
COPY ./actix/resources ./resources
RUN cargo install --path .
RUN cargo build --release
FROM gcr.io/distroless/cc-debian10
EXPOSE 2000
COPY --from=build /usr/local/cargo/bin/actix /usr/local/bin/actix
WORKDIR /opt
CMD ["actix"]
COPY --from=build /simply-shorten/target/release/simply-shorten /opt/simply-shorten
COPY --from=build /simply-shorten/resources /opt/resources
COPY ./urls.sqlite /opt/urls.sqlite
CMD ["./simply-shorten"]