-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 886 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 886 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
# API image for Render, Fly.io, Railway, etc.
# Note: Whisper + PyTorch are large; free tiers may OOM or cold-start slowly.
FROM python:3.11-slim-bookworm
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg git build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY backend ./backend
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -e ./backend
# Pre-download Whisper tiny during build (build VM has RAM). Cuts first-request RAM vs download+load together.
ENV OMP_NUM_THREADS=1
RUN python -c "import whisper; whisper.load_model('tiny')"
ENV PORT=8000
ENV MKL_NUM_THREADS=1
ENV OPENBLAS_NUM_THREADS=1
ENV NUMEXPR_NUM_THREADS=1
EXPOSE 8000
# DATABASE_URL, CORS_ORIGINS, WHISPER_MODEL, ASSEMBLY_AI_API_KEY — set in host dashboard
CMD uvicorn audio_transcription.api.main:app --host 0.0.0.0 --port ${PORT}