add Dockerfile
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
|||||||
|
FROM python:3.8.14-buster
|
||||||
|
MAINTAINER PAN Lei<panleicim@gmail.com>
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
RUN echo "==> Updating and installing packages" && \
|
||||||
|
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list &&\
|
||||||
|
echo 'deb-src http://deb.debian.org/debian buster main' >> /etc/apt/sources.list &&\
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y software-properties-common && \
|
||||||
|
apt-get install -y build-essential gcc automake autoconf libtool && \
|
||||||
|
apt-get build-dep -y pocketsphinx && \
|
||||||
|
apt-get install -y bison python-pyaudio && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
COPY requirements.txt requirements.txt
|
||||||
|
RUN pip3 install --upgrade pip
|
||||||
|
RUN pip3 install -r requirements.txt
|
||||||
|
COPY src src
|
||||||
|
COPY server.py server.py
|
||||||
|
CMD [ "python3", "server.py", "--host=0.0.0.0"]
|
||||||
@@ -7,6 +7,7 @@ dataclasses~=0.6
|
|||||||
SpeechRecognition==3.8.1
|
SpeechRecognition==3.8.1
|
||||||
pymongo==4.1.1
|
pymongo==4.1.1
|
||||||
wget==3.2.0
|
wget==3.2.0
|
||||||
|
pocketsphinx==0.1.15
|
||||||
oci~=2.54.1
|
oci~=2.54.1
|
||||||
XlsxWriter~=3.0.3
|
XlsxWriter~=3.0.3
|
||||||
playwright-stealth==1.0.5
|
playwright-stealth==1.0.5
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ def post():
|
|||||||
vid.write(request.data)
|
vid.write(request.data)
|
||||||
speech_to_text = SpeechToText()
|
speech_to_text = SpeechToText()
|
||||||
result = speech_to_text.to_text(file_name)
|
result = speech_to_text.to_text(file_name)
|
||||||
|
print(result)
|
||||||
try:
|
try:
|
||||||
os.remove(file_name)
|
os.remove(file_name)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|||||||
Reference in New Issue
Block a user