forked from frkri/ModelRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 1.07 KB
/
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
29
30
31
32
# Specifically use Debian 12 due to the runtime image running also running on Debian 12
FROM rust:1.77.2-bookworm as builder
# Compile without any optimizations by default
ARG rust_flags=""
WORKDIR /ModelRunner
COPY . /ModelRunner
ENV RUSTFLAGS=${rust_flags}
RUN cargo build --release --bin model_runner
RUN cargo build --release --bin model_runner_health
FROM gcr.io/distroless/cc-debian12 as runtime
LABEL org.opencontainers.image.source="https://github.com/frkri/ModelRunner"
LABEL org.opencontainers.image.title="ModelRunner"
LABEL org.opencontainers.image.license="MIT"
WORKDIR /ModelRunner
COPY --from=builder /ModelRunner/target/release/model_runner model_runner
COPY --from=builder /ModelRunner/target/release/model_runner_health model_runner_health
# Required for the sqlite database
COPY ./migrations migrations
# Required for the whisper model
COPY ./melfilters.bytes melfilters.bytes
# Set the RUST_LOG environment variable to 'debug' to see more verbose logs
ENV RUST_LOG=info
# By default, modelrunner will listen on port 25566
EXPOSE 25566
ENTRYPOINT ["./model_runner"]