File size: 617 Bytes
2286d88
f9f77ec
2286d88
f9f77ec
2286d88
 
 
 
f9f77ec
2286d88
 
f9f77ec
2286d88
 
 
 
 
 
 
 
 
 
 
f9f77ec
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
# Dockerfile for lightweight Playwright + FastAPI app on Hugging Face Space

FROM python:3.11-slim

# Install dependencies
RUN apt-get update && apt-get install -y \
  libnss3 libatk-bridge2.0-0 libgtk-3-0 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2 curl \
  && rm -rf /var/lib/apt/lists/*

# Install Playwright and FastAPI dependencies
RUN pip install --no-cache-dir fastapi uvicorn "playwright>=1.37.0" httpx

# Install Playwright browsers
RUN playwright install

WORKDIR /app

COPY ./app /app

ENV PORT=7860
EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]