-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 755 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM rust:latest AS build
WORKDIR /app
COPY server/Cargo.toml server/Cargo.lock ./
COPY server/src/ src/
RUN cargo build --release
RUN find . -type f -name libtensorflow.so.1 -exec cp {} . \; \
&& find . -type f -name libtensorflow_framework.so.1 -exec cp {} . \;
FROM debian:buster-slim
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/target/release/actix-tf-server /usr/local/bin/actix-tf-server
COPY --from=build /app/*.so.1 /usr/lib/
COPY saved_model/ /app/saved_model/
RUN useradd -mU -s /bin/bash actix
USER actix
EXPOSE 8080
ENTRYPOINT ["actix-tf-server", "--model-dir=/app/saved_model"]