Spaces:
Running
Running
File size: 988 Bytes
e81dd9a 983ae19 7240f9c e81dd9a 42e4f57 acfdffe 80c1cd0 7240f9c e3722cf e81dd9a 80c1cd0 42e4f57 e81dd9a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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"] |