-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.debian
More file actions
47 lines (35 loc) · 1.55 KB
/
Dockerfile.debian
File metadata and controls
47 lines (35 loc) · 1.55 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# ─── Stage 1: Builder ────────────────────────────────────────────────────────
FROM rust:slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
pkg-config \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy manifests first to cache dependency compilation
COPY Cargo.toml Cargo.lock ./
# Create a dummy binary so cargo can resolve and compile all dependencies
# before the real source is copied in (improves layer caching).
RUN mkdir -p src \
&& echo 'fn main() {}' > src/main.rs \
&& cargo build --release 2>/dev/null || true \
&& rm -rf src
# Copy real source and build
COPY src ./src
RUN touch src/main.rs \
&& cargo build --release
# ─── Stage 2: Runtime ────────────────────────────────────────────────────────
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/open-stt-server /usr/local/bin/open-stt-server
# HuggingFace model cache — mount a volume here to persist downloads
VOLUME ["/root/.cache/huggingface"]
ENV OPEN_STT_PORT=8080 \
OPEN_STT_MODELS=whisper-base \
OPEN_STT_DOWNLOAD=true \
RUST_LOG=info
EXPOSE 8080
ENTRYPOINT ["open-stt-server"]