diff --git a/.gitignore b/.gitignore index ea8c4bf..651f071 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +vendor \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 63c03d4..d7a3530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -643,14 +643,6 @@ version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259" -[[package]] -name = "librarian-proxy" -version = "0.1.0" -dependencies = [ - "actix-web", - "awc", -] - [[package]] name = "local-channel" version = "0.1.2" @@ -1040,6 +1032,14 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "stream-proxy" +version = "0.1.0" +dependencies = [ + "actix-web", + "awc", +] + [[package]] name = "syn" version = "1.0.91" diff --git a/Cargo.toml b/Cargo.toml index 2904081..3063023 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "librarian-proxy" +name = "stream-proxy" version = "0.1.0" edition = "2021" @@ -7,4 +7,10 @@ edition = "2021" [dependencies] actix-web = { version = "4" } -awc = { version = "3", features = ["rustls"] } \ No newline at end of file +awc = { version = "3", features = ["rustls"] } + +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d5ffc2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM rust:alpine AS build + +WORKDIR /src +RUN apk --no-cache add musl-dev git ca-certificates +RUN git clone https://codeberg.org/librarian/stream-proxy . + +RUN cargo vendor +RUN cargo build --release +RUN ls target/release + +FROM scratch as bin + +WORKDIR /app +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=build /src/target/release/stream-proxy . + +EXPOSE 3001 + +CMD ["/app/stream-proxy"] \ No newline at end of file