From 1c6ba5fe66566034465c4ecabecfd7365464c491 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 16 Oct 2024 12:44:02 +0000 Subject: [PATCH] feat: rewrite Dockerfile.r4userembeddingwithmodel Dockerfile --- Dockerfile.r4userembeddingwithmodel | 11 ++++++++--- Dockerfile.r4userembeddingwithmodeltest | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile.r4userembeddingwithmodel b/Dockerfile.r4userembeddingwithmodel index 9d698ef..2b9f16c 100755 --- a/Dockerfile.r4userembeddingwithmodel +++ b/Dockerfile.r4userembeddingwithmodel @@ -2,7 +2,7 @@ FROM ubuntu:jammy As builder # RUN apk add openssl-dev musl-dev g++ -RUN mkdir -p /userembedding && \ +RUN mkdir -p /userembedding/model && \ apt update && \ apt install curl -y && \ curl https://sh.rustup.rs -sSf | bash -s -- -y && \ @@ -27,10 +27,15 @@ ENV MODEL_INTERNET="false" WORKDIR /userembedding +RUN mkdir -p /userembedding/model # Copy our build -COPY --from=builder /root/.cache/huggingface /root/.cache/huggingface +COPY --from=builder /userembedding/model /userembedding/model COPY --from=builder /userembedding/target/release/userembedding ./ +COPY --from=builder /userembedding/target/release/downloadmodel ./ +COPY --from=builder /userembedding/target/release/buildmodelfromlocal ./ -CMD ["/userembedding/userembedding"] \ No newline at end of file + +CMD ["/userembedding/userembedding"] +# ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/Dockerfile.r4userembeddingwithmodeltest b/Dockerfile.r4userembeddingwithmodeltest index b1ae063..7907dd4 100755 --- a/Dockerfile.r4userembeddingwithmodeltest +++ b/Dockerfile.r4userembeddingwithmodeltest @@ -2,7 +2,7 @@ FROM ubuntu:jammy As builder # RUN apk add openssl-dev musl-dev g++ -RUN mkdir -p /userembedding && \ +RUN mkdir -p /userembedding/model && \ apt update && \ apt install curl -y && \ curl https://sh.rustup.rs -sSf | bash -s -- -y && \ @@ -27,13 +27,15 @@ ENV MODEL_INTERNET="false" WORKDIR /userembedding +RUN mkdir -p /userembedding/model # Copy our build -COPY --from=builder /root/.cache/huggingface /root/.cache/huggingface +COPY --from=builder /userembedding/model /userembedding/model COPY --from=builder /userembedding/target/release/userembedding ./ COPY --from=builder /userembedding/target/release/downloadmodel ./ COPY --from=builder /userembedding/target/release/buildmodelfromlocal ./ + # CMD ["/userembedding/userembedding"] ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file