-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.cpu
42 lines (26 loc) · 872 Bytes
/
Dockerfile.cpu
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
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}-slim AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
WORKDIR /workspace
FROM base AS python-env
RUN python3 -m venv venv
ENV PATH="/workspace/venv/bin:$PATH"
COPY requirements-cpu.txt .
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install -r requirements-cpu.txt \
&& pip install -r requirements.txt
FROM base AS runtime
COPY --from=python-env /workspace/venv /workspace/venv
ENV PATH="/workspace/venv/bin:$PATH"
WORKDIR /workspace
COPY src/whisperx_api_server ./whisperx_api_server
ENV UVICORN_HOST=0.0.0.0
ENV UVICORN_PORT=8000
CMD ["uvicorn", "--factory", "whisperx_api_server.main:create_app"]