FROM python:3.10-slim # working directory WORKDIR /code ENV HF_HOME=/tmp/huggingface_cache ENV TORCH_HOME=/tmp/torch_cache # explicitly create cache directory RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME RUN mkdir -p $TORCH_HOME && chmod -R 777 $TORCH_HOME # dependency req by open cv RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY . /code/ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]