Spaces:
Running
Running
FROM python:3.9-slim | |
RUN apt-get update && apt-get install -y \ | |
gcc \ | |
python3-dev \ | |
curl \ | |
gnupg \ | |
libxml2-dev \ | |
libxslt-dev \ | |
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \ | |
&& apt-get install -y nodejs \ | |
&& npm install -g playwright \ | |
&& playwright install-deps chromium \ | |
&& playwright install chromium | |
WORKDIR /app | |
RUN mkdir -p templates && \ | |
curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/api.py -o api.py && \ | |
curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/requirements.txt -o requirements.txt && \ | |
curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/index.html -o templates/index.html | |
RUN pip install --no-cache-dir -r requirements.txt | |
RUN pip install flask | |
ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright \ | |
PYTHONUNBUFFERED=1 | |
EXPOSE 7860 | |
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300"] |