File size: 558 Bytes
e3194db
8a9d638
 
 
39e06a1
8a9d638
 
 
 
 
d6ecd4b
1
2
3
4
5
6
7
8
9
10
11
FROM python:3.11
WORKDIR /code
RUN chmod 777 /code 
RUN python -m pip install --upgrade pip && \
    pip install nest_asyncio requests waitress flask[async] gradio_client flask-cors gunicorn gevent bs4 huggingface_hub

RUN --mount=type=secret,id=token,mode=0444,required=true \ 
    --mount=type=secret,id=url,mode=0444,required=true \
    curl -H "Authorization: Bearer $(cat /run/secrets/token)" -o app.py $(cat /run/secrets/url)
COPY . .
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--timeout", "120", "--workers", "4", "--worker-class", "sync"]