matrix-spam-ml

git clone git://archive.git.mtrnord.blog/MTRNord/matrix-spam-ml.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3341284960ba72860c6a0cbdda242a96b789823b
parent d2b5ee8927a11981ef03b7ee3a06d8f100cc3a9e
Author: MTRNord <mtrnord1@gmail.com>
Date:   Mon, 10 Oct 2022 21:29:40 +0200

Try a hack from https://github.com/kykosic/actix-tensorflow-example/blob/master/Dockerfile

Diffstat:
MDockerfile | 24++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/Dockerfile b/Dockerfile @@ -1,23 +1,4 @@ -FROM rust:1.64 as builder - -# Install tensorflow -RUN apt-get update && apt-get install -y curl - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 - -RUN apt-get update && apt-get install -y \ - python3 \ - python3-pip - -RUN python3 -m pip --no-cache-dir install --upgrade \ - "pip<20.3" \ - setuptools - -# Some TF tools expect a "python" binary -RUN ln -s $(which python3) /usr/local/bin/python - -RUN python3 -m pip install --no-cache-dir tensorflow +FROM rust:1.64 WORKDIR /app COPY ./crates /app/crates @@ -28,6 +9,9 @@ RUN ls -la target/release/build/tensorflow-sys-*/out RUN find / -name libtensorflow* RUN ldd /app/target/release/model_server +RUN find . -type f -name libtensorflow.so.2 -exec cp {} /usr/lib/ \; \ + && find . -type f -name libtensorflow_framework.so.2 -exec cp {} /usr/lib/ \; + ENV MODEL_PATH /app/models/matrix_spam # Copy the model files to the image COPY ./models/spam_keras_1664583738.3207538 /app/models/matrix_spam