qdqd commited on
Commit
983ae19
·
verified ·
1 Parent(s): 42e4f57

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -6,6 +6,8 @@ RUN apt-get update && apt-get install -y \
6
  python3-dev \
7
  curl \
8
  gnupg \
 
 
9
  && curl -sL https://deb.nodesource.com/setup_16.x | bash - \
10
  && apt-get install -y nodejs \
11
  && npm install -g playwright \
@@ -14,21 +16,18 @@ RUN apt-get update && apt-get install -y \
14
 
15
  WORKDIR /app
16
 
17
- # Download application files directly from Hugging Face
18
  RUN mkdir -p templates && \
19
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/api.py -o api.py && \
20
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/requirements.txt -o requirements.txt && \
21
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/index.html -o templates/index.html
22
 
23
- # Install Python dependencies
24
- RUN pip install --no-cache-dir -r requirements.txt
 
25
 
26
- # Create necessary directories
27
- RUN mkdir -p static
28
-
29
- # Hugging Face Space environment configuration
30
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright \
31
- PLAYWRIGHT_HEADLESS=true \
32
  PYTHONUNBUFFERED=1
33
 
34
  EXPOSE 7860
 
6
  python3-dev \
7
  curl \
8
  gnupg \
9
+ libxml2-dev \
10
+ libxslt-dev \
11
  && curl -sL https://deb.nodesource.com/setup_16.x | bash - \
12
  && apt-get install -y nodejs \
13
  && npm install -g playwright \
 
16
 
17
  WORKDIR /app
18
 
19
+ # Download application files
20
  RUN mkdir -p templates && \
21
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/api.py -o api.py && \
22
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/requirements.txt -o requirements.txt && \
23
  curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/index.html -o templates/index.html
24
 
25
+ # Install Python dependencies with fixed versions
26
+ RUN pip install --no-cache-dir -r requirements.txt \
27
+ && pip install lxml[html_clean]==4.9.4 lxml_html_clean==3.0.0
28
 
29
+ # Configure environment
 
 
 
30
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright \
 
31
  PYTHONUNBUFFERED=1
32
 
33
  EXPOSE 7860