FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10 | |
RUN apt-get update && apt-get install -y \ | |
ffmpeg \ | |
libgl1-mesa-dev \ | |
libgles2-mesa-dev \ | |
libglu1-mesa-dev \ | |
build-essential \ | |
cmake \ | |
freeglut3-dev \ | |
libglfw3-dev \ | |
libglew-dev \ | |
libsdl2-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libfreetype6-dev \ | |
mesa-utils \ | |
libgl1-mesa-dri \ | |
libgl1-mesa-glx \ | |
curl \ | |
python3-dev \ | |
libpq-dev \ | |
libasound2-dev \ | |
portaudio19-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Install a release version of `broken-source` wheel | |
RUN python3 -m pip install broken-source==0.3.3.dev0 | |
COPY . /app | |
WORKDIR /app | |
# Download and install the depthflow binary | |
RUN curl -L -o /usr/local/bin/depthflow https://github.com/BrokenSource/DepthFlow/releases/latest/download/depthflow-cpu-linux-amd64-latest.bin | |
RUN chmod +x /usr/local/bin/depthflow | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |