From ad5dcdd760063bd11e0273a3b36041c86b356db7 Mon Sep 17 00:00:00 2001 From: Chad Bailey Date: Wed, 24 Jan 2024 21:15:05 +0000 Subject: [PATCH] Dockerfile --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..7acfa2de8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# setup +FROM python:3.11.5 + +WORKDIR /app +COPY requirements.txt /app +COPY *.py /app +COPY pyproject.toml /app + +COPY src/ /app/src/ + +WORKDIR /app +RUN ls --recursive /app/ +RUN pip3 install --upgrade -r requirements.txt +RUN python -m build . +RUN pip3 install . + +# If running on Ubuntu, Azure TTS requires some extra config +# https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform?pivots=programming-language-python&tabs=linux%2Cubuntu%2Cdotnetcli%2Cdotnet%2Cjre%2Cmaven%2Cnodejs%2Cmac%2Cpypi + +RUN wget -O - https://www.openssl.org/source/openssl-1.1.1w.tar.gz | tar zxf - +WORKDIR openssl-1.1.1w +RUN ./config --prefix=/usr/local +RUN make -j $(nproc) +RUN make install_sw install_ssldirs +RUN ldconfig -v +ENV SSL_CERT_DIR=/etc/ssl/certs + +#ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH +RUN apt clean +RUN apt-get update +RUN apt-get -y install build-essential libssl-dev ca-certificates libasound2 wget + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +EXPOSE 8000 +# run +CMD ["gunicorn", "--workers=2", "--log-level", "debug", "--capture-output", "daily-bot-manager:app", "--bind=0.0.0.0:8000"]