From c6f9c9420e12633a80121fe9a0950d880d6dc697 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Tue, 11 Jul 2023 14:40:12 +0800 Subject: [PATCH] add Dockerfile --- Dockerfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ server.py | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..98f82c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 + +ARG DEBIAN_FRONTEND=noninteractive + +# Remove any third-party apt sources to avoid issues with expiring keys. +RUN rm -f /etc/apt/sources.list.d/*.list + +# Install some basic utilities. +RUN apt-get update && apt-get install -y \ + curl \ + ca-certificates \ + sudo \ + git \ + bzip2 \ + libx11-6 \ + && rm -rf /var/lib/apt/lists/* + +RUN apt update + +# install python +RUN apt install software-properties-common -y && \ + add-apt-repository ppa:deadsnakes/ppa && \ + apt update + +RUN apt install python3-dev -y && \ + apt install python-is-python3 + + +# install pip +RUN apt install python3-pip -y + +# Create a working directory. +RUN mkdir /app +WORKDIR /app + +COPY setup.sh /app +COPY requirements/ /app + +RUN bash setup.sh +RUN pip install -r server.txt + +COPY *py /app + +CMD ["python", "server.py"] diff --git a/server.py b/server.py index 82f3d06..f189214 100644 --- a/server.py +++ b/server.py @@ -277,5 +277,5 @@ class ServeClient: if __name__ == "__main__": - with serve(recv_audio, "127.0.0.1", 9090) as server: + with serve(recv_audio, "0.0.0.0", 9090) as server: server.serve_forever() \ No newline at end of file