File size: 678 Bytes
7be7abf
 
92652e2
7be7abf
92652e2
 
7be7abf
 
 
92652e2
 
 
7be7abf
92652e2
 
7be7abf
 
 
92652e2
 
 
 
7be7abf
 
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
# Use the official Playwright image which has all system deps pre-installed
FROM ://microsoft.com

# Set up a non-root user for Hugging Face compatibility
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# Install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Playwright browsers are already in the image, 
# but we ensure the Python links are ready
RUN python3 -m playwright install chromium

# Copy application code
COPY --chown=user . .

# Run with Xvfb to provide a display for the browser
CMD ["xvfb-run", "-a", "python3", "app.py"]