-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
50 lines (33 loc) · 1 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM python:3.12-slim-bookworm as base
ARG DEV=false
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
RUN apt-get update
FROM base as builder
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
ENV PATH "/usr/bin/ffprobe:$PATH"
WORKDIR /app
RUN pip install --upgrade pip
# Install Poetry
RUN pip install poetry==1.8.2
# Install the app
# COPY pyproject.toml poetry.lock ./
COPY pyproject.toml ./
# webrtcvad :
RUN apt-get install -y gcc
RUN apt-get install -y portaudio19-dev python3-pyaudio
RUN apt-get install -y ffmpeg libavcodec-extra
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR;
FROM base as runtime
RUN apt-get update && apt-get install -y \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
WORKDIR /app
COPY speech2text ./speech2text
COPY main.py ./main.py
ENV PATH "/usr/bin/ffmpeg:$PATH"
ENTRYPOINT ["python", "main.py" ]