qdqd commited on
Commit
e81dd9a
·
verified ·
1 Parent(s): bcb8837

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ gcc \
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 \
12
+ && playwright install-deps chromium \
13
+ && playwright install chromium
14
+
15
+ WORKDIR /app
16
+
17
+ # Install Python dependencies
18
+ COPY requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Download your specific files
22
+ RUN curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/api.py -o api.py
23
+ RUN curl -L https://huggingface.co/datasets/qdqd/web-api/resolve/main/requirements.txt -o requirements.txt
24
+
25
+ # Hugging Face Spaces specific settings
26
+ ENV PLAYWRIGHT_BROWSERS_PATH=/app/ms-playwright
27
+
28
+ EXPOSE 7860
29
+
30
+ CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300"]