File size: 680 Bytes
5d70302
7a16830
a885622
b90c198
1c79a0d
6824706
bdbed1e
7a16830
c4f3c3d
7820aa6
 
7a16830
 
1
2
3
4
5
6
7
8
9
10
11
12
13
FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
WORKDIR /code
RUN chmod 777 /code 
RUN python -m pip install --upgrade pip && \
    pip install aiohttp requests flask[async] flask-cors waitress gunicorn gevent playwright bs4 huggingface_hub 
RUN playwright install --with-deps firefox    

RUN mkdir -p /.cache && chmod 777 /.cache
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", "gevent"]