-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (22 loc) · 729 Bytes
/
Dockerfile
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
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 d | grep "libtorch/lib$" | xargs -I{} mv {} libtorch
FROM debian:buster-slim
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
libgomp1 \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/target/release/actix-torch-server /usr/local/bin/actix-torch-server
copy --from=build /app/libtorch/* /usr/lib/
COPY saved_model/ /app/saved_model/
RUN useradd -mU -s /bin/bash actix
USER actix
EXPOSE 8080
ENTRYPOINT ["actix-torch-server", "--model-path=/app/saved_model/model.pt"]